-
Notifications
You must be signed in to change notification settings - Fork 967
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Inconsistent startup behaviour on daily tasks at midnight - Timezone related #609
Comments
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: timezone information in docker container: UTC |
It is even worse: When I use It get's actually called every time |
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
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. |
It doesn't fix the issue for me |
I got the exact same issue; removing the time zone and setting it in the Docker container environment is the workaround in my case. |
same issue for me, using version is: 1.2.1 |
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).
The text was updated successfully, but these errors were encountered: