HangfireIO / Cronos

A fully-featured .NET library for working with Cron expressions. Built with time zones in mind and intuitively handles daylight saving time transitions
MIT License
1.01k stars 118 forks source link

L-3 raises invalid interval after running #42

Closed xj42 closed 3 years ago

xj42 commented 3 years ago

I have this cron expression "0 0 L-3 ". It worked fine until after that point in time, then is crashed with the exception below.

System.ArgumentException: Invalid value '2375713936.2261' for parameter 'interval'. at System.Timers.Timer..ctor(Double interval) at Domain.Services.CronJobService.ScheduleJob(CancellationToken cancellationToken) in E:\SourceCode\LDS\src\Domain\Domain.Services\CronJobService.cs:line 37 at Domain.Services.CronJobService.StartAsync(CancellationToken cancellationToken) in E:\SourceCode\LDS\src\Domain\Domain.Services\CronJobService.cs:line 24 at LDS.ReportService.CassetteRefilList.StartAsync(CancellationToken cancellationToken) in E:\SourceCode\LDS\src\LDS\LDS.ReportService\Reports\CassetteRefilList.cs:line 46 at Microsoft.Extensions.Hosting.Internal.Host.StartAsync(CancellationToken cancellationToken) at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token) at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token) at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.Run(IHost host)

If I change the expression to "0 0 L " there is no issue.

I tried changing the expression "0 0 24 " - Works "0 0 25 " - Exception all expressions with the date above 24 give the exception.

any ideas?

odinserj commented 3 years ago

Please see https://stackoverflow.com/questions/1624789/maximum-timer-interval this question doesn't relate to Cronos.