aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJP Dillingham <jp@dillingham.me>2025-10-18 18:01:55 -0500
committerJP Dillingham <jp@dillingham.me>2025-10-18 18:01:55 -0500
commit5899521238415c6f5fc8b3fb37ceab2cbd82b328 (patch)
tree92a7688d92c5c7d8787617f254b0db1e2a90ed9b /src
parentb4f57596898948606d014dda6f7531d0567a5b63 (diff)
downloadslskd-5899521238415c6f5fc8b3fb37ceab2cbd82b328.tar.gz
tweax
Diffstat (limited to 'src')
-rw-r--r--src/slskd/Transfers/Downloads/DownloadService.cs12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/slskd/Transfers/Downloads/DownloadService.cs b/src/slskd/Transfers/Downloads/DownloadService.cs
index 9beb8077..f4e10565 100644
--- a/src/slskd/Transfers/Downloads/DownloadService.cs
+++ b/src/slskd/Transfers/Downloads/DownloadService.cs
@@ -628,7 +628,7 @@ namespace slskd.Transfers.Downloads
context.SaveChanges();
enqueued.Add(transfer);
- Log.Information("Successfully enqueued download of {Filename} from {Username} (id: {Id})", file.Filename, username, transfer.Id);
+ Log.Information("Successfully locally enqueued download of {Filename} from {Username}", file.Filename, username, transfer.Id);
}
catch (Exception ex)
{
@@ -652,7 +652,7 @@ namespace slskd.Transfers.Downloads
// prime the cache for this user, to 1) make sure we can connect, and 2) avoid needing to race for it in the loop
try
{
- Log.Debug("Priming message connection to {Username}", enqueued.Count, username);
+ Log.Debug("Priming message connection to {Username}", username);
await Client.ConnectToUserAsync(username, invalidateCache: false, cancellationToken);
}
catch (Exception ex)
@@ -666,7 +666,7 @@ namespace slskd.Transfers.Downloads
we'll proceed with downloading them, but in a separate task run in the background
*/
- Log.Debug("Scheduling batch enqueue Task for {Count} files from {Username}", enqueued.Count, username);
+ Log.Debug("Scheduling batch remote enqueue Task for {Count} files from {Username}", enqueued.Count, username);
var batchEnqueueTask = Task.Run(async () =>
{
@@ -703,6 +703,7 @@ namespace slskd.Transfers.Downloads
var enqueuedTcs = new TaskCompletionSource<Transfer>();
List<string> transitions = [];
+ TransferStates state = TransferStates.None;
// set a hard limit on the time we are willing to wait for the remote client to confirm or reject
// the enqueue of the file. we have to do this so that we don't get stuck indefinitely
@@ -718,6 +719,7 @@ namespace slskd.Transfers.Downloads
void stateChanged(Transfer transfer)
{
+ state = transfer.State;
transitions.Add(transfer.State.ToString());
// _contractually_ (covered by unit tests!) all downloads will at some point enter the Queued | Remotely state
@@ -809,6 +811,8 @@ namespace slskd.Transfers.Downloads
// wait for the download to either enter the Queued | Remotely or Completed states, or for the hard limit
// timeout to trip and set an exception
await enqueuedTcs.Task;
+
+ Log.Debug("Download of {Filename} from {Username} successfully entered state {State}", state);
}
catch (Exception ex)
{
@@ -854,7 +858,7 @@ namespace slskd.Transfers.Downloads
{
if (task.IsCompletedSuccessfully)
{
- Log.Warning("Task for batch enqueue of {Count} files from {Username} completed successfully", files.Count(), username);
+ Log.Information("Task for batch enqueue of {Count} files from {Username} completed successfully", files.Count(), username);
return;
}