-
Notifications
You must be signed in to change notification settings - Fork 132
Description
I might (and often do) have the following requirements:
- I want a job to run every 30 minutes.
- I don't care what the actual time of the execution is, i.e. I don't want/need every such job to run on the 0th and 30th minute of each hour. 14/44 or 22/52 would be fine.
- I'd really prefer that such jobs get spread out.
Prior art: Jenkins has this via a "special" letter H. I didn't realize how useful this was until I met Jenkins, and now I think it should be everywhere. The two basic formats supported are H and H/N for any N:
Hpicks any value in the range, e.g. 0-59 for minutes/seconds, 0-23 for hours, etc.H/Ndescribes an interval, e.g.H/15could be 13/28/43/58 for minutes/seconds,H/8could be 3/11/19 for hours, etc.. IMHO it should be highly recommended to use even divisors, and in their absence I think it's reasonable to not support "rollover memory", i.e. I don't thinkH/31really needs to worry about firing at 00:00, 00:31, 01:02, 01:33, 02:04, 02:35, etc.
For expressions to be calculated reproducibly, they would need a seed. In the HangFire context, that's probably something like a recurringJobId. I'm not sure how you'd want that detail to cross project boundaries -- if you can provide some guidance on that, and this feature sounds like a good idea to you, I'm happy to work/collaborate on this.
If it's not something you'd want to support natively, I'd love any suggestions you might have on how this could be implemented from the outside.