schedule
schedule copied to clipboard
Add the functionality to run jobs at monthly or yearly intervals on specific dates
resolve #487
This PR will implement the feature discussed in the above issue.
To summarize this issue
- The functionality to schedule on a monthly or yearly unit is needed.
- Considering the job persistence that @gabrielcipriano points out, we should not simply add the functionality to schedule on a monthly or yearly unit.
- In light of these considerations, it is desirable to design the system to allow scheduling on a monthly or yearly unit as long as the specific dates are specified, which is the idea of @ttamg.
Therefore, I have implemented the feature that allows scheduling on a monthly or yearly unit by specifying a specific date.
This feature can be used as follows
# Run jobs on the 5th of each month.
schedule.every().date("05").do(job)
# Run jobs at 9:00 on Dec 5th every two years.
schedule.every(2).date("12/05").at("09:00").do(job)
Your review and comments would be greatly appreciated.
Any progress on merging this? I also need this functionality.
I agree monthly and yearly would be great additions, but I would like to make an additional suggestion for the monthly, namely the first and last of the month with offsets: .firstof() would then be the 1st of the month .lastof() would be the last of the month.
Offsets could then be done as follows: .firstof(1) would then be the 2nd of the month .lastoff(1) would then be the day before the last day of the month.
bump, PR becoming stale?