Merge pull request #1187 from adenchen123/master

Delay one second inside LockAsync in crontab watcher
This commit is contained in:
Nick Yi 2025-10-16 08:45:14 +08:00 committed by GitHub
commit c09214fefc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -31,14 +31,11 @@ public class CrontabWatcher : BackgroundService
while (!stoppingToken.IsCancellationRequested)
{
var delay = Task.Delay(1000, stoppingToken);
await locker.LockAsync(DIST_KEY, async () =>
{
await RunCronChecker(scope.ServiceProvider);
await Task.Delay(1000, stoppingToken);
});
await delay;
}
_logger.LogWarning("Crontab Watcher background service is stopped.");