Hi,
I am using Hangfire for recurring jobs with a variable timespan. So what I do is to create a recurring job and when the job runs, inside the job I use
RecurringJob.AddOrUpdate<TwitterPostJobs>(hangfireJob.JobId.ToString(), x => x.DoTwitterPost(hangfireJob, JobCancellationToken.Null), Cron.MinuteInterval(randomMinSpan));
with a
Cron.MinuteInterval(randomMinSpan)
as parameter. There seems to be a problem if the time span is > 60. The job is still executed every 60 minutes. Even if the hangfire dashboard shows
9cca7f2e-f042-4c96-9be7-107e115b3030 */185 * * * * UTC TwitterPostJobs.DoTwitterPost in an hour 15 minutes ago 20 hours ago
Am I right, that I need to recalculate timespans > 60 Minutes in cron expression syntax? Because a test at
gives me the same result back:
Cron format 0 0/185 * 1/1 * ? *
Start time Sunday, August 19, 2018 4:18 PM Change
Next scheduled dates
1. Sunday, August 19, 2018 5:00 PM
2. Sunday, August 19, 2018 6:00 PM
3. Sunday, August 19, 2018 7:00 PM
4. Sunday, August 19, 2018 8:00 PM
5. Sunday, August 19, 2018 9:00 PM
Thanks!