Skip to content
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

instant execution of job with every().days.at on first run #603

Open
alkanex-xyz opened this issue Oct 19, 2023 · 6 comments
Open

instant execution of job with every().days.at on first run #603

alkanex-xyz opened this issue Oct 19, 2023 · 6 comments

Comments

@alkanex-xyz
Copy link

alkanex-xyz commented Oct 19, 2023

When I schedule a job with schedule.every().days.at("00:00:20", timezone("Europe/Amsterdam")).do() the job will run immediately even if the first call of run_pending is at 15:00.

How can i prevent the instant execution? The first execution shall be at the next day

Python3.11
Schedule 1.2.1

@alkanex-xyz
Copy link
Author

maybe some additional infos:

On my windows 11 PC this doesn't seems to happen. On the script running in kubernetes containers on mediawikis toolforge servers it seems to occure only on jobs which are scheduled in hour 0 and 1.

The servers time is set to UTC.

@alkanex-xyz
Copy link
Author

Further tests:

When I set my timezone to UTC the same thing occurs. If the job is scheduled between 00:00 and 01:59 (MEST) the task will run immediately and additional: the task is immediately rescheduled after each run. I would guess till the 2 hours offset between UTC and MEST have passed

@SijmenHuizenga
Copy link
Collaborator

Thank you the detailed explanation and investigation. This is indeed a bug. I've started working on a fix in #604

@SijmenHuizenga
Copy link
Collaborator

Hi @alkanex-xyz, the fix in #604 seems to work good with the test cases I can come up with. Would you be willing to also take a look at it? Either by reviewing, running it as part of your program or by writing a unit-test like the these ones that represents your situation? Any testing/reviewing help would be super helpful to move this forward.

@alkanex-xyz
Copy link
Author

Hey,
I've tested my case and the schedule run as intended. Thanks a lot .

@wasnertobias
Copy link

#609 Sorry I did create a duplicate, did not find this issue before as I thought it was Docker related. The issue is still persisting for me.

@SijmenHuizenga SijmenHuizenga mentioned this issue May 13, 2024
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants