mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2024-11-19 18:11:36 +01:00
make sure the LndInvoiceClientSession get disposed, even if it fails at initialization
This commit is contained in:
parent
1814cb2d6e
commit
fe8428b8b0
@ -40,6 +40,8 @@ namespace BTCPayServer.Payments.Lightning.Lnd
|
||||
}
|
||||
|
||||
public async Task StartListening()
|
||||
{
|
||||
try
|
||||
{
|
||||
_Client = _Parent.CreateHttpClient();
|
||||
_Client.Timeout = TimeSpan.FromMilliseconds(Timeout.Infinite);
|
||||
@ -52,6 +54,12 @@ namespace BTCPayServer.Payments.Lightning.Lnd
|
||||
ListenLoop();
|
||||
#pragma warning restore CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed
|
||||
}
|
||||
catch
|
||||
{
|
||||
_Stopped.Set();
|
||||
Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
private async Task ListenLoop()
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user