[postgres-Server-V2] feat: Convert DateTime.Now calls to UtcNow

This commit is contained in:
Alessandro Benetton
2025-02-01 21:58:50 +01:00
parent bd9e79d026
commit 45ca2695eb
7 changed files with 9 additions and 9 deletions

View File

@ -24,9 +24,9 @@ internal abstract class DownloadClient
: TrangaSettings.requestLimits[requestType];
TimeSpan timeBetweenRequests = TimeSpan.FromMinutes(1).Divide(rateLimit);
_lastExecutedRateLimit.TryAdd(requestType, DateTime.Now.Subtract(timeBetweenRequests));
_lastExecutedRateLimit.TryAdd(requestType, DateTime.UtcNow.Subtract(timeBetweenRequests));
TimeSpan rateLimitTimeout = timeBetweenRequests.Subtract(DateTime.Now.Subtract(_lastExecutedRateLimit[requestType]));
TimeSpan rateLimitTimeout = timeBetweenRequests.Subtract(DateTime.UtcNow.Subtract(_lastExecutedRateLimit[requestType]));
if (rateLimitTimeout > TimeSpan.Zero)
{
@ -34,7 +34,7 @@ internal abstract class DownloadClient
}
RequestResult result = MakeRequestInternal(url, referrer, clickButton);
_lastExecutedRateLimit[requestType] = DateTime.Now;
_lastExecutedRateLimit[requestType] = DateTime.UtcNow;
return result;
}