diff --git a/src/Infrastructure/BotSharp.Core.Crontab/Services/CrontabWatcher.cs b/src/Infrastructure/BotSharp.Core.Crontab/Services/CrontabWatcher.cs index d50735208..e49cabbcd 100644 --- a/src/Infrastructure/BotSharp.Core.Crontab/Services/CrontabWatcher.cs +++ b/src/Infrastructure/BotSharp.Core.Crontab/Services/CrontabWatcher.cs @@ -31,14 +31,11 @@ protected override async Task ExecuteAsync(CancellationToken stoppingToken) 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.");