Skip to content

Commit

Permalink
Fix: Skip on startup condition
Browse files Browse the repository at this point in the history
  • Loading branch information
danilbrenner committed Dec 5, 2024
1 parent 9515d65 commit 7213388
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ protected override async Task ExecuteAsync(CancellationToken stoppingToken)
while (!stoppingToken.IsCancellationRequested)
{
logger.LogInformation("{ScheduledServiceType}: Is active", GetType().Name);
if(_next is null && !skipOnStartup)
if(_next is not null || !skipOnStartup)
await RunAsync(stoppingToken);
_next = cron.GetNextOccurrence(DateTime.Now);
logger.LogInformation("{ScheduledServiceType}: Scheduling next run for {Next}", GetType().Name, _next.Value);
Expand Down

0 comments on commit 7213388

Please sign in to comment.