This commit is contained in:
Stanley Dimant
2025-02-07 23:59:43 +01:00

View File

@@ -77,10 +77,9 @@ public class FileStatisticsService : IHostedService
_metrics.SetGaugeTo(MetricsAPI.GaugeFilesUniquePastDay, 0); _metrics.SetGaugeTo(MetricsAPI.GaugeFilesUniquePastDay, 0);
_metrics.SetGaugeTo(MetricsAPI.GaugeFilesUniquePastDaySize, 0); _metrics.SetGaugeTo(MetricsAPI.GaugeFilesUniquePastDaySize, 0);
var now = DateTime.UtcNow; var now = DateTime.UtcNow;
TimeOnly currentTime = new(now.Hour, now.Minute, now.Second); DateTime midnight = new(now.Date, new(0, 0, 0));
TimeOnly futureTime = new(0, 0, 0); var span = midnight.AddDays(1) - now;
var span = futureTime - currentTime;
await Task.Delay(span, _resetCancellationTokenSource.Token).ConfigureAwait(false); await Task.Delay(span, _resetCancellationTokenSource.Token).ConfigureAwait(false);
} }