aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/slskd/Application.cs4
-rw-r--r--src/slskd/Core/API/Controllers/ApplicationController.cs4
-rw-r--r--src/slskd/Relay/RelayClient.cs2
-rw-r--r--src/slskd/Search/SearchService.cs2
-rw-r--r--src/slskd/Shares/ShareScanner.cs2
-rw-r--r--src/slskd/Transfers/Downloads/DownloadService.cs2
-rw-r--r--src/slskd/Transfers/Uploads/UploadService.cs2
7 files changed, 9 insertions, 9 deletions
diff --git a/src/slskd/Application.cs b/src/slskd/Application.cs
index 461a5fef..208de9e1 100644
--- a/src/slskd/Application.cs
+++ b/src/slskd/Application.cs
@@ -128,7 +128,7 @@ namespace slskd
Console.CancelKeyPress += (_, args) =>
{
ShuttingDown = true;
- Program.MasterCancellationTokenSource.Cancel();
+ Program.MasterCancellationTokenSource.Cancel(swallowObjectDisposedException: true);
Log.Warning("Received SIGINT");
};
@@ -137,7 +137,7 @@ namespace slskd
PosixSignals.Add(PosixSignalRegistration.Create(signal, context =>
{
ShuttingDown = true;
- Program.MasterCancellationTokenSource.Cancel();
+ Program.MasterCancellationTokenSource.Cancel(swallowObjectDisposedException: true);
Log.Fatal("Received {Signal}", signal);
Environment.Exit(1);
}));
diff --git a/src/slskd/Core/API/Controllers/ApplicationController.cs b/src/slskd/Core/API/Controllers/ApplicationController.cs
index e015e612..09d9eda2 100644
--- a/src/slskd/Core/API/Controllers/ApplicationController.cs
+++ b/src/slskd/Core/API/Controllers/ApplicationController.cs
@@ -94,7 +94,7 @@ namespace slskd.Core.API
[Authorize(Policy = AuthPolicy.JwtOnly, Roles = AuthRole.AdministratorOnly)]
public IActionResult Shutdown()
{
- Program.MasterCancellationTokenSource.Cancel();
+ Program.MasterCancellationTokenSource.Cancel(swallowObjectDisposedException: true);
Lifetime.StopApplication();
Task.Run(async () =>
@@ -114,7 +114,7 @@ namespace slskd.Core.API
[Authorize(Policy = AuthPolicy.JwtOnly, Roles = AuthRole.AdministratorOnly)]
public IActionResult Restart()
{
- Program.MasterCancellationTokenSource.Cancel();
+ Program.MasterCancellationTokenSource.Cancel(swallowObjectDisposedException: true);
Process.Start(Process.GetCurrentProcess().MainModule.FileName, Environment.CommandLine);
Lifetime.StopApplication();
diff --git a/src/slskd/Relay/RelayClient.cs b/src/slskd/Relay/RelayClient.cs
index cbcde3c4..49935b4c 100644
--- a/src/slskd/Relay/RelayClient.cs
+++ b/src/slskd/Relay/RelayClient.cs
@@ -279,7 +279,7 @@ namespace slskd.Relay
// if the client is attempting a connection, cancel it it's going to be dropped when we create a new instance, but
// we need the retry loop around connection to stop.
- StartCancellationTokenSource?.Cancel();
+ StartCancellationTokenSource?.Cancel(swallowObjectDisposedException: true);
HubConnection = new HubConnectionBuilder()
.WithUrl($"{options.Relay.Controller.Address.TrimEnd('/')}/hub/relay", builder =>
diff --git a/src/slskd/Search/SearchService.cs b/src/slskd/Search/SearchService.cs
index 8b107084..ec45bb5c 100644
--- a/src/slskd/Search/SearchService.cs
+++ b/src/slskd/Search/SearchService.cs
@@ -416,7 +416,7 @@ namespace slskd.Search
{
if (CancellationTokens.TryGetValue(id, out var cts))
{
- cts.Cancel();
+ cts.Cancel(swallowObjectDisposedException: true);
return true;
}
diff --git a/src/slskd/Shares/ShareScanner.cs b/src/slskd/Shares/ShareScanner.cs
index 98a3f092..7ae1aa4e 100644
--- a/src/slskd/Shares/ShareScanner.cs
+++ b/src/slskd/Shares/ShareScanner.cs
@@ -457,7 +457,7 @@ namespace slskd.Shares
{
if (CancellationTokenSource != null)
{
- CancellationTokenSource.Cancel();
+ CancellationTokenSource.Cancel(swallowObjectDisposedException: true);
return true;
}
diff --git a/src/slskd/Transfers/Downloads/DownloadService.cs b/src/slskd/Transfers/Downloads/DownloadService.cs
index 5a5fe699..21e33523 100644
--- a/src/slskd/Transfers/Downloads/DownloadService.cs
+++ b/src/slskd/Transfers/Downloads/DownloadService.cs
@@ -555,7 +555,7 @@ namespace slskd.Transfers.Downloads
// state of slskd to diverge from the internal state of Soulseek.NET.
// the transfer record is recorded as being cancelled when this happens and there's not
// an easy/good way to stop it.
- cts.Cancel();
+ cts.Cancel(swallowObjectDisposedException: true);
});
// satisfies conditions #1 and #2
diff --git a/src/slskd/Transfers/Uploads/UploadService.cs b/src/slskd/Transfers/Uploads/UploadService.cs
index 05251ecf..246f4b31 100644
--- a/src/slskd/Transfers/Uploads/UploadService.cs
+++ b/src/slskd/Transfers/Uploads/UploadService.cs
@@ -970,7 +970,7 @@ namespace slskd.Transfers.Uploads
{
if (CancellationTokens.TryRemove(id, out var cts))
{
- cts.Cancel();
+ cts.Cancel(swallowObjectDisposedException: true);
return true;
}