fix: 重连动作取消令箭未生效 (#97)

This commit is contained in:
Diego
2025-12-03 21:28:07 +08:00
committed by GitHub
parent f37f0411ce
commit d008c3e3de

View File

@@ -117,6 +117,9 @@ public class ReconnectionOption<TClient>
while (this.MaxRetryCount < 0 || attempts < this.MaxRetryCount)
{
if (cancellationToken.IsCancellationRequested)
return;
if (client.PauseReconnection)
{
if (this.LogReconnection)
@@ -147,6 +150,9 @@ public class ReconnectionOption<TClient>
}
catch (Exception ex)
{
if (cancellationToken.IsCancellationRequested)
return;
this.OnFailed?.Invoke(client, attempts, ex);
if (this.LogReconnection)