Bug when combining triggers #649
Replies: 2 comments
-
As the message states, it's a warning. And it has nothing whatsoever to do with the combined trigger not working. The cron trigger only triggers when all the fields in a datetime match its values. The interval trigger, however, records its start time as the current time, which usually includes a nonzero number of microseconds and seconds. Therefore these triggers never coincide, hence the problem you're seeing. Have you considered the following? scheduler.add_job(
send_delivery_notifications,
CronTrigger(day_of_week="mon-sat", hour="8-20", minute="*/5"),
args=[dispatcher.bot],
max_instances=1
) |
Beta Was this translation helpful? Give feedback.
-
Help me please. I have a similar problem with combining triggers.
|
Beta Was this translation helpful? Give feedback.
-
Describe the bug
Hi! When combining the CronTrigger and the IntervalTrigger, the following message gets printed in the console, and does not let the execution continue.
apscheduler\util.py:436: PytzUsageWarning: The localize method is no longer necessary, as this time zone supports the fold attribute (PEP 495). For more details on migrating to a PEP 495-compliant implementation, see https://pytz-deprecation-shim.readthedocs.io/en/latest/migration.html return tzinfo.localize(dt)
To Reproduce
This is the code I'm using:
If I remove one of the triggers, it works. But when they're combined is when it fails.
Additional context
Version: 3.9.1
Beta Was this translation helpful? Give feedback.
All reactions