aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJP Dillingham <jp@dillingham.me>2025-10-26 16:08:22 -0500
committerJP Dillingham <jp@dillingham.me>2025-10-26 16:08:22 -0500
commite21916a250fd983a5564fff85c62e30986c869b5 (patch)
tree4ddabc9b5a649cac6623d2d5b9d455767e503ed5 /src
parent16c9b47cc977800a567b59fba7986d475524ae9d (diff)
downloadslskd-e21916a250fd983a5564fff85c62e30986c869b5.tar.gz
remove and dispose cancellation tokens on failure
Diffstat (limited to 'src')
-rw-r--r--src/slskd/Transfers/Downloads/DownloadService.cs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/slskd/Transfers/Downloads/DownloadService.cs b/src/slskd/Transfers/Downloads/DownloadService.cs
index 10c8c0bc..3c78dae6 100644
--- a/src/slskd/Transfers/Downloads/DownloadService.cs
+++ b/src/slskd/Transfers/Downloads/DownloadService.cs
@@ -494,6 +494,12 @@ namespace slskd.Transfers.Downloads
Log.Error(ex, "Failed to enqueue download of {Filename} from {Username}: {Message}", file.Filename, username, ex.Message);
TryFail(transferId, exception: ex);
failed.Add(file.Filename);
+
+ if (CancellationTokens.TryRemove(transferId, out var cts))
+ {
+ cts.Dispose();
+ }
+
continue;
}
} // end foreach()