From ecae97699382ca688d59fc686cee18ca482b52ae Mon Sep 17 00:00:00 2001 From: "nicolas.dorier" Date: Tue, 18 Jun 2019 13:37:24 +0900 Subject: [PATCH] Make sure we don't timeout on NBX --- BTCPayServer/ExplorerClientProvider.cs | 2 +- BTCPayServer/Hosting/BTCPayServerServices.cs | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/BTCPayServer/ExplorerClientProvider.cs b/BTCPayServer/ExplorerClientProvider.cs index 44614243b..f5836c50b 100644 --- a/BTCPayServer/ExplorerClientProvider.cs +++ b/BTCPayServer/ExplorerClientProvider.cs @@ -33,7 +33,7 @@ namespace BTCPayServer Logs.Configuration.LogInformation($"{setting.CryptoCode}: Cookie file is {(setting.CookieFile ?? "not set")}"); if (setting.ExplorerUri != null) { - _Clients.TryAdd(setting.CryptoCode, CreateExplorerClient(httpClientFactory.CreateClient($"NBXPLORER_{setting.CryptoCode}"), _NetworkProviders.GetNetwork(setting.CryptoCode), setting.ExplorerUri, setting.CookieFile)); + _Clients.TryAdd(setting.CryptoCode, CreateExplorerClient(httpClientFactory.CreateClient(nameof(ExplorerClientProvider)), _NetworkProviders.GetNetwork(setting.CryptoCode), setting.ExplorerUri, setting.CookieFile)); } } } diff --git a/BTCPayServer/Hosting/BTCPayServerServices.cs b/BTCPayServer/Hosting/BTCPayServerServices.cs index 7cf22bc95..dd4967400 100644 --- a/BTCPayServer/Hosting/BTCPayServerServices.cs +++ b/BTCPayServer/Hosting/BTCPayServerServices.cs @@ -60,6 +60,10 @@ namespace BTCPayServer.Hosting o.UseOpenIddict, BTCPayOpenIdToken, string>(); }); services.AddHttpClient(); + services.AddHttpClient(nameof(ExplorerClientProvider), httpClient => + { + httpClient.Timeout = Timeout.InfiniteTimeSpan; + }); services.TryAddSingleton(); services.TryAddSingleton(); services.TryAddSingleton();