dotnet-labs/ServiceWorkerCronJob

Cronjob running after cronexpression

kevinvenclovas opened this issue · 1 comments

Hello, i added a new Cronjob running every 10 minutes between 4 and 23 o'clock. When the job is running on 23:00:00 O'clock then the function GetNextOccurrence returned 23:10:00 but why? My cronjob sould only run from 4 - 23 o'clock.

service.AddCronJob<GDIEMailEventsCronjob>(c =>
{
      c.CronExpression = @"*/10 * 4-23 * *";
      c.CronJobType = CronJobType.GDI_EMAIL_EVENT;
});
public DateTime GetNextRunningTime(DateTime startTime)
{
  return schedule.GetNextOccurrence(startTime);
}

image

Sorry my expression was wrong :/ -> */10 4-23 * * *