简体   繁体   中英

Hangfire keeps running recurring jobs late

So I have several recurring jobs that are supposed to run on a certain hour:

    RecurringJob.AddOrUpdate(() => Runner.SendTestEmail(), Cron.Daily, TimeZoneInfo.Local);
    RecurringJob.AddOrUpdate(() => Runner.CleanProjectFiles(), "0 0 * * *", TimeZoneInfo.Local);
    RecurringJob.AddOrUpdate(() => Runner.IPAudit(), Cron.Daily, TimeZoneInfo.Local);

These are all supposed to run at midnight, however they are running at all times of the day.

The last time all of my midnight jobs ran was at 5:13 AM.

I checked the time and timezone of the box hosting the site, I set the QueuePollInterval to 15 seconds but things are still running several hours late.

The SQL box is different from the box hosting the site, however I made sure to check the time there as well to make sure that everything was the same.

Does anyone have any suggestions as to how I could fix this issue?

Is there something I have to configure in IIS?

Thank you UtopiaLtd, your answer worked perfectly.

Is your app pool set to recycle with no traffic? With Hangfire, if a tree is scheduled to fall in the forest, it will wait to make a sound until there's someone to hear it, so to speak. The app pool needs to be alive for Hangfire to run

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM