From 08ea902c6830eb9da12a481c5d46e39d21fbf203 Mon Sep 17 00:00:00 2001 From: mainLink0435 Date: Fri, 5 Jun 2026 20:04:09 +1000 Subject: [PATCH] fix: add 60s cooldown between symlink download retries When the symlink downloader cannot find files on the rclone mount (because the CDN hasn't populated yet), wait 60 seconds before retrying to avoid thrashing the mount with repeated searches. --- server/RdtClient.Service/Services/TorrentRunner.cs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/server/RdtClient.Service/Services/TorrentRunner.cs b/server/RdtClient.Service/Services/TorrentRunner.cs index 0ee1cbd..1c35e4d 100644 --- a/server/RdtClient.Service/Services/TorrentRunner.cs +++ b/server/RdtClient.Service/Services/TorrentRunner.cs @@ -1,4 +1,4 @@ -using System.Collections.Concurrent; +using System.Collections.Concurrent; using System.Diagnostics; using System.Text.Json; using Aria2NET; @@ -216,9 +216,15 @@ public class TorrentRunner( if (download.RetryCount < download.Torrent.DownloadRetryAttempts) { - Log($"Retrying download", download, download.Torrent); + var retryDelay = download.Torrent.DownloadClient == Data.Enums.DownloadClient.Symlink + ? TimeSpan.FromMinutes(1) + : TimeSpan.Zero; - await downloads.Reset(downloadId); + var retryAt = DateTimeOffset.UtcNow.Add(retryDelay); + + Log($"Retrying download at {retryAt:u}", download, download.Torrent); + + await downloads.Reset(downloadId, retryAt); await downloads.UpdateRetryCount(downloadId, download.RetryCount + 1); } else