Closed qpzmm2000 closed 10 months ago
Can you tell me more about the use case and how can I reproduce the issue. I just tried to make the following calls, and get the output as expected. Also, what version of Hangfire.Core you are using?
RecurringJob.AddOrUpdate("initially-disabled", () => Console.WriteLine("Disabled"), "0 0 30 2 *");
RecurringJob.AddOrUpdate("initially-disabled", () => Console.WriteLine("Now enabled"), "* * * * *");
The bug occur on version 1.8.3 and fixed on the latest version. Thank you.
Initally I have created a job with "0 0 30 2 *" because I am not sure the schedule. It will be marked as "disable" and I can trigger the job manually. If I call the method AddOrUpdate to update the schedule, the cron expression will be updated but the job will never run.
I checked the HangFire.Set table is not updating. The cron on HangFire.Hash is updated but the NextExecution is empty. There is a workaround by deleting the job and call the AddOrUpdate again to change the schedule.