Unable to schedule from a specific time and following a specific calendar
Author: gigittygitCreated Aug 28, 2023Updated Dec 2, 2024
The library supports scheduling until a certain time but not from time. Consequently, it is difficult to implement logic such as every hour on Monday-Friday from 11:30 to 12:30.
We created a custom function that generates a list of options, in this case
- every().monday.at("11:30")
- every().monday.at("12:30")
- every().tuesday.at("12:30")
- ..,
- every().friday.at("12:30")
This implies 15 calls, as opposed to only 5 calls per each day, or just 1 call per calendar that sets Monday to Friday eligible.
With a more frequent schedule, this becomes even more prohibitive. In such a case, we just run the job at every().minute and exit early when outside of schedule from job function, i.e. manage schedule externally.
Any enhancements planned? Any idea how to enhance internally the library?
- every().monday.from('11:30').to('12:30')
- every().minute.on(calendar).from('11:30').to('12:30')
Source: dbader/schedule