mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-18 14:34:23 +01:00
Do not save cache of rates in the database (#6978)
We were previously saving the rates in the database in a JSONB blob column. However, the volume of data ise consequential enough for provoking timeouts during update. Due to how postgres works, this also create bloat in the database that isn't cleaned immediately. This PR fixes this issue by saving the cache in files instead.
This commit is contained in:
@@ -38,6 +38,7 @@ using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.DependencyInjection.Extensions;
|
||||
using NBitcoin;
|
||||
using NBitcoin.Payment;
|
||||
using NBitcoin.RPC;
|
||||
@@ -448,7 +449,7 @@ namespace BTCPayServer
|
||||
public static IServiceCollection AddScheduledTask<T>(this IServiceCollection services, TimeSpan every)
|
||||
where T : class, IPeriodicTask
|
||||
{
|
||||
services.AddSingleton<T>();
|
||||
services.TryAddSingleton<T>();
|
||||
services.AddTransient<ScheduledTask>(o => new ScheduledTask(typeof(T), every));
|
||||
return services;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user