Execute a recurring job in Hangfire every 8 days

后端 未结 2 1715
执念已碎
执念已碎 2021-02-07 11:16

Is it possible to create a recurring job in Hangfire that executes after a given number of days, say 8.

The nearest I found was to execute a job once in a week -

<
2条回答
  •  滥情空心
    2021-02-07 11:37

    A more cleaner Solution will be to use Cron.DayInterval(interval).

    For your case it will be

    RecurringJob.AddOrUpdate("MyJob",() => ScheduledJob(), Cron.DayInterval(8));
    

提交回复
热议问题