diff options
| author | JP Dillingham <jpdillingham@gmail.com> | 2021-06-14 07:56:48 -0500 |
|---|---|---|
| committer | JP Dillingham <jpdillingham@gmail.com> | 2021-06-14 07:56:48 -0500 |
| commit | ac2aca6a2dd4c6299d7b39a99b5545e94d1efbe4 (patch) | |
| tree | df489494232f9c4957dc1b5299a8b15edebc0d41 /src | |
| parent | 0fa875be594d15ebf162c2728f95fa623b825fa2 (diff) | |
| download | slskd-ac2aca6a2dd4c6299d7b39a99b5545e94d1efbe4.tar.gz | |
throw ApplicationShutdownException when stopping, don't try to reconnect if caught
Diffstat (limited to 'src')
| -rw-r--r-- | src/slskd/Core/Service.cs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/slskd/Core/Service.cs b/src/slskd/Core/Service.cs index 5800ffa0..7a1e511f 100644 --- a/src/slskd/Core/Service.cs +++ b/src/slskd/Core/Service.cs @@ -154,7 +154,7 @@ namespace slskd public Task StopAsync(CancellationToken cancellationToken) { - Client.Disconnect("Shutting down"); + Client.Disconnect("Shutting down", new ApplicationShutdownException("Shutting down")); Client.Dispose(); Logger.Information("Client stopped"); return Task.CompletedTask; @@ -213,7 +213,7 @@ namespace slskd private async void Client_Disconnected(object sender, SoulseekClientDisconnectedEventArgs args) { - if (args.Exception is ObjectDisposedException) + if (args.Exception is ObjectDisposedException || args.Exception is ApplicationShutdownException) { Logger.Debug("Disconnected from the Soulseek server: the client is shutting down"); } |
