dbader / schedule

Python job scheduling for humans.
https://schedule.readthedocs.io/
MIT License
11.73k stars 959 forks source link

RFC: Constant interval scheduling "on XXX" #523

Open kfmfe04 opened 2 years ago

kfmfe04 commented 2 years ago

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

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?