diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/slskd/Transfers/Downloads/DownloadService.cs | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/src/slskd/Transfers/Downloads/DownloadService.cs b/src/slskd/Transfers/Downloads/DownloadService.cs index a84a494d..a46130c9 100644 --- a/src/slskd/Transfers/Downloads/DownloadService.cs +++ b/src/slskd/Transfers/Downloads/DownloadService.cs @@ -532,6 +532,18 @@ namespace slskd.Transfers.Downloads throw; } + // 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}", username); + await Client.ConnectToUserAsync(username, invalidateCache: false, cancellationToken); + } + catch (Exception ex) + { + Log.Error(ex, "Failed to connect to {Username}: {Message}", username, ex.Message); + throw; + } + List<string> acquiredLocks = []; try @@ -647,20 +659,6 @@ namespace slskd.Transfers.Downloads return (enqueued, failed); } - Log.Debug("Attempting to remotely enqueue {Count} files from {Username}", enqueued.Count, username); - - // 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}", username); - await Client.ConnectToUserAsync(username, invalidateCache: false, cancellationToken); - } - catch (Exception ex) - { - Log.Error(ex, "Failed to connect to {Username}: {Message}", username, ex.Message); - throw; - } - /* the files are all now in the database in the Queued | Locally state. |
