Make sure SSH does not throw in separate thread

This commit is contained in:
nicolas.dorier 2019-11-18 17:15:40 +09:00
parent 81843fb609
commit 92777ba181
No known key found for this signature in database
GPG Key ID: 6618763EF09186FE
2 changed files with 19 additions and 15 deletions

View File

@ -70,6 +70,8 @@ namespace BTCPayServer
sshCommand.CommandTimeout = v;
var tcs = new TaskCompletionSource<SSHCommandResult>(TaskCreationOptions.RunContinuationsAsynchronously);
new Thread(() =>
{
try
{
sshCommand.BeginExecute(ar =>
{
@ -87,6 +89,8 @@ namespace BTCPayServer
sshCommand.Dispose();
}
});
}
catch(Exception ex) { tcs.TrySetException(ex); }
})
{ IsBackground = true }.Start();
return tcs.Task;

View File

@ -1,5 +1,5 @@
<Project>
<PropertyGroup>
<Version>1.0.3.139</Version>
<Version>1.0.3.141</Version>
</PropertyGroup>
</Project>