schedule icon indicating copy to clipboard operation
schedule copied to clipboard

RFC: Constant interval scheduling "on XXX"

Open kfmfe04 opened this issue 3 years ago • 0 comments

Request for Comments

I have a task that I want run on :00, :05, ..., :55 seconds.
I couldn't find a example of this so I wrote a snippet that works:

for i in range(0,60,5):
    schedule.every().minute.at(":%02d" % i).do(job)

If this functionality exists, please do let me know.

Disadvantages

  • I have 12 tasks when it's really one task run, so a flood of tags will be messy
  • Its readability fails miserably compared to the beautiful semantics in the current API

Now, it would be nice if we could do something like: schedule.on_the.hour().do(job) but I'm not sure how we would generalize it for all cases.

For my example above, schedule.on_the.every(5).minute.do(job) sounds a bit awkward.

Any suggestions/comments?

kfmfe04 avatar Apr 13 '22 00:04 kfmfe04