mirror of
https://github.com/PepperDash/Essentials.git
synced 2026-08-31 10:58:28 +00:00
fix(core-ssh): harden GenericSshClient shutdown reconnect guards
This commit is contained in:
parent
a55e4811b3
commit
4ca59e3186
1 changed files with 4 additions and 5 deletions
|
|
@ -228,15 +228,14 @@ namespace PepperDash.Core
|
|||
return;
|
||||
}
|
||||
|
||||
ConnectEnabled = true;
|
||||
|
||||
if (_isProgramStopping)
|
||||
{
|
||||
this.LogDebug("Skipping connect because program is stopping");
|
||||
ConnectEnabled = false;
|
||||
return;
|
||||
}
|
||||
|
||||
ConnectEnabled = true;
|
||||
|
||||
try
|
||||
{
|
||||
connectLock.Wait();
|
||||
|
|
@ -517,7 +516,7 @@ namespace PepperDash.Core
|
|||
this.LogError("ObjectDisposedException sending '{message}'. Restarting connection...", text.Trim());
|
||||
|
||||
KillClient(SocketStatus.SOCKET_STATUS_CONNECT_FAILED);
|
||||
if (ConnectEnabled && !_isProgramStopping)
|
||||
if (AutoReconnect && ConnectEnabled && !_isProgramStopping)
|
||||
{
|
||||
StartReconnectTimer();
|
||||
}
|
||||
|
|
@ -553,7 +552,7 @@ namespace PepperDash.Core
|
|||
this.LogException(ex, "ObjectDisposedException sending {message}", ComTextHelper.GetEscapedText(bytes));
|
||||
|
||||
KillClient(SocketStatus.SOCKET_STATUS_CONNECT_FAILED);
|
||||
if (ConnectEnabled && !_isProgramStopping)
|
||||
if (AutoReconnect && ConnectEnabled && !_isProgramStopping)
|
||||
{
|
||||
StartReconnectTimer();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue