From cd5b334a00983d13dfd311cb6107e9ccb86f6f46 Mon Sep 17 00:00:00 2001 From: "nicolas.dorier" Date: Sat, 26 Oct 2019 23:40:35 +0900 Subject: [PATCH] Make sure renci ssh does not prevent btcpay from closing --- BTCPayServer/HostedServices/CheckConfigurationHostedService.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/BTCPayServer/HostedServices/CheckConfigurationHostedService.cs b/BTCPayServer/HostedServices/CheckConfigurationHostedService.cs index c3b6b50c4..33db3d5a9 100644 --- a/BTCPayServer/HostedServices/CheckConfigurationHostedService.cs +++ b/BTCPayServer/HostedServices/CheckConfigurationHostedService.cs @@ -81,7 +81,8 @@ namespace BTCPayServer.HostedServices _cancellationTokenSource.Cancel(); try { - await _testingConnection; + // Renci SSH sometimes is deadlocking, so we just wait at most 5 seconds + await Task.WhenAny(_testingConnection, Task.Delay(5000, _cancellationTokenSource.Token)); } catch { } Logs.PayServer.LogInformation($"{this.GetType().Name} successfully exited...");