c# - Execute a recurring job in Hangfire every 8 days -
is possible create recurring job in hangfire executes after given number of days, 8.
the nearest found execute job once in week -
recurringjob.addorupdate("myjob",() => scheduledjob(), cron.weekly());
understanding hangfire accepts standard cronexpression
, i've tried exploring cron expression frequency couldn't found 1 it- https://en.wikipedia.org/wiki/cron
one ugly solution create 3 or 4 jobs executes once in month @ dates accordingly, don't want that.
any suggestions please.
finally have used cronexpression
schedule recurring job frequency of every 8 days or number of days matter.
string cronexp = "* * */8 * *"; recurringjob.addorupdate("myjob",() => scheduledjob(), cronexp);
the third segment in cronexpression
represents day of month.
the respective segments follows - (ref: https://en.wikipedia.org/wiki/cron)
Comments
Post a Comment