psimakis10/29/2020, 10:22 AM
I know that filters are applied in scheduler level but it could be very handy to apply filtering on clock level. Is there any (even hackie) way to achieve this? If is not possible, is there any way to provide more that one scheduler to a flow? Thanks in advance!
schedules.Schedule( clocks=[ clocks.IntervalClock(timedelta(hours=1)), # clock 0: fire every hour clocks.IntervalClock(timedelta(hours=5)), # clock 1: fire every five hours ], # but only on weekdays for the second clock filters=[filters.is_weekday_clock_1] )
Raphaël Riel10/29/2020, 12:11 PM
for this Scheduler. 1st Cron:
0 */1 * * *
This way wou’ll get the expected result, without the need of Filters.
0 */5 * * 1-5
At minute 0 past every 5th hour on every day-of-week from Monday through Friday.
psimakis10/29/2020, 12:38 PM
>>> import datetime >>> import croniter >>> cron = croniter.croniter('0 0 1-7 * 4') >>> cron.get_next(datetime.datetime) datetime.datetime(2020, 11, 1, 0, 0) >>> cron.get_next(datetime.datetime) datetime.datetime(2020, 11, 2, 0, 0) >>> cron.get_next(datetime.datetime) datetime.datetime(2020, 11, 3, 0, 0)
Raphaël Riel10/29/2020, 12:57 PM
will skip the Legacy/Problematic Behaviour: https://stackoverflow.com/questions/34357126/why-crontab-uses-or-when-both-day-of-month-and-day-of-week-specified On my side:
psimakis10/29/2020, 1:13 PM
psimakis11/04/2020, 3:01 PM