diff --git a/BTCPayServer/HostedServices/RatesHostedService.cs b/BTCPayServer/HostedServices/RatesHostedService.cs index cf6fb1b62..7c0002f23 100644 --- a/BTCPayServer/HostedServices/RatesHostedService.cs +++ b/BTCPayServer/HostedServices/RatesHostedService.cs @@ -115,20 +115,24 @@ namespace BTCPayServer.HostedServices private async Task TryLoadRateCache() { - var cache = await _SettingsRepository.GetSettingAsync(); - if (cache != null) + try { - _LastCacheDate = cache.Created; - var stateByExchange = cache.States.ToDictionary(o => o.ExchangeName); - foreach (var provider in _RateProviderFactory.Providers) + var cache = await _SettingsRepository.GetSettingAsync(); + if (cache != null) { - if (stateByExchange.TryGetValue(provider.Key, out var state) && - provider.Value is BackgroundFetcherRateProvider fetcher) + _LastCacheDate = cache.Created; + var stateByExchange = cache.States.ToDictionary(o => o.ExchangeName); + foreach (var provider in _RateProviderFactory.Providers) { - fetcher.LoadState(state); + if (stateByExchange.TryGetValue(provider.Key, out var state) && + provider.Value is BackgroundFetcherRateProvider fetcher) + { + fetcher.LoadState(state); + } } } } + catch { } } DateTimeOffset? _LastCacheDate; diff --git a/Build/Version.csproj b/Build/Version.csproj index da4be94b0..f5a4f7215 100644 --- a/Build/Version.csproj +++ b/Build/Version.csproj @@ -1,5 +1,5 @@ - 1.0.3.157 + 1.0.3.158