Open wasnertobias opened 7 months ago
Further information: This is most likely a timezone related issue. Only when scheduling the "day_rollover" task to run at "01:00" it is not running on startup, when e.g. trying "00:05" it still is running on startup!
timezone information on linux host machine: timedatectl Local time: Fri 2023-12-08 15:31:06 CET Universal time: Fri 2023-12-08 14:31:06 UTC RTC time: Fri 2023-12-08 14:31:06 Time zone: Europe/Berlin (CET, +0100) System clock synchronized: yes NTP service: active RTC in local TZ: no
timezone information in docker container: UTC date Fri Dec 8 14:33:59 UTC 2023
It is even worse: When I use
schedule.every().days.at("00:00", timezone_string).do(day_rollover)
It get's actually called every time schedule.run_pending()
is called between 00:00 and 01:00, which is every second for me. So in total it gets called 3600 times instead of once.
Having the same problem, but I'm calling it without a timeout so my job gets called 500k each day. Looks like the job is immediately scheduled again until 01:00.
schedule.every().day.at("00:30", "Europe/Amsterdam").do(run_task)
while True:
next_job = schedule.idle_seconds()
delay = next_job if next_job is not None else 60
await asyncio.sleep(delay)
try:
await asyncio.to_thread(schedule.run_pending)
except BaseException as e:
await asyncio.sleep(60)
Having same issue when running inside a container under AWS ECS. Anything on a fixed schedule is not launched
schedule.every().day.at("16:50:00").do(my_task)
I tried with and without seconds. Tried with UTC and local time.. no luck
Having same issue when running inside a container under AWS ECS. Anything on a fixed schedule is not launched
schedule.every().day.at("16:50:00").do(my_task)
I tried with and without seconds. Tried with UTC and local time.. no luck
I ended up changing libraries as I did not get it working. Recommend the following when it comes to timezones: https://digon.io/hyd/project/scheduler/t/master/pages/examples/timezones.html
Having same issue when running inside a container under AWS ECS. Anything on a fixed schedule is not launched
schedule.every().day.at("16:50:00").do(my_task)
I tried with and without seconds. Tried with UTC and local time.. no luck
I ended up changing libraries as I did not get it working. Recommend the following when it comes to timezones: https://digon.io/hyd/project/scheduler/t/master/pages/examples/timezones.html
Thanks for sharing
Current master fixed my issue, so a new release could help others as well.
Current master fixed my issue, so a new release could help others as well.
It doesn't fix the issue for me
It is even worse: When I use
schedule.every().days.at("00:00", timezone_string).do(day_rollover)
It get's actually called every time
schedule.run_pending()
is called between 00:00 and 01:00, which is every second for me. So in total it gets called 3600 times instead of once.
I got the exact same issue; removing the time zone and setting it in the Docker container environment is the workaround in my case.
It is even worse: When I use
schedule.every().days.at("00:00", timezone_string).do(day_rollover)
It get's actually called every time
schedule.run_pending()
is called between 00:00 and 01:00, which is every second for me. So in total it gets called 3600 times instead of once.
same issue for me, using version is: 1.2.1
It is even worse: When I use
schedule.every().days.at("00:00", timezone_string).do(day_rollover)
It get's actually called every time
schedule.run_pending()
is called between 00:00 and 01:00, which is every second for me. So in total it gets called 3600 times instead of once.
Same issue for me as well. Version 1.2.2.
timezone_string = 'Europe/Berlin'
This does not get run on a startup
schedule.every().day.at("13:05", timezone_string).do(day_rollover)
Whereas this runs on startup instantly
schedule.every().day.at("00:00", timezone_string).do(day_rollover)
2023-12-08 15:16:12,838 - INFO - Scheduler started 2023-12-08 15:16:12,839 - DEBUG - Running job Job(interval=1, unit=days, do=day_rollover, args=(), kwargs={})
However, this behavior is different on different machines. I am not able to reproduce this on my Windows machine (running exactly the same version of schedule 1.2.1) in a virtual env, but I was able to reproduce this on a Linux Server, where the python application is running in a docker container (I can provide you with the Dockerfile if needed).