From 9248cb5eafe0de2dd48b22743a1cc42cd010d61d Mon Sep 17 00:00:00 2001 From: glax Date: Fri, 3 Oct 2025 19:37:57 +0200 Subject: [PATCH] Fix downloads not working, with timeout using DateTime.Now instead of UTC --- API/MangaDownloadClients/DownloadClient.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/API/MangaDownloadClients/DownloadClient.cs b/API/MangaDownloadClients/DownloadClient.cs index d4f5741..0df3f51 100644 --- a/API/MangaDownloadClients/DownloadClient.cs +++ b/API/MangaDownloadClients/DownloadClient.cs @@ -31,11 +31,11 @@ public abstract class DownloadClient // Apply the delay TimeSpan timeBetweenRequests = TimeSpan.FromMinutes(1).Divide(rateLimit); - DateTime now = DateTime.Now; + DateTime now = DateTime.UtcNow; LastExecutedRateLimit.TryAdd(requestType, now.Subtract(timeBetweenRequests)); TimeSpan rateLimitTimeout = timeBetweenRequests.Subtract(now.Subtract(LastExecutedRateLimit[requestType])); - Log.Debug($"Request limit {requestType} {rateLimit}/Minute timeBetweenRequests: {timeBetweenRequests:ss'.'fffff} Timeout: {rateLimitTimeout:ss'.'fffff}"); + Log.Debug($"Request limit {requestType} {rateLimit}/Minute timeBetweenRequests: {timeBetweenRequests:ss'.'fffff}"); if (rateLimitTimeout > TimeSpan.Zero) {