-
Notifications
You must be signed in to change notification settings - Fork 971
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
Running at a specific time weekly calls job twice. #178
Comments
Thanks for the detailed report @bbengfort, really appreciate it. Unfortunately I don't have the bandwidth right now to further investigate, but if you (or anybody else interested) wants to submit a PR with a fix + a test case to prevent regressions I can make time to review it and prepare a new release. |
Btw I'm assuming this happens on 0.5.0, is that correct? |
@dbader I completely understand about bandwidth; we've switched to And yes, it happens on 0.5.0; we observed it on both 0.5.0 and 0.4.3. |
Sounds good, and again, thanks for the detailed report :-) |
We ran into a minor bug when scheduling
schedule.every().sunday.at("6:00").do(myfunc)
--myfunc
is called twice because next run is not updated correctly.This is clearly difficult to give a test case for unless it happens to be near the time the schedule is set to run for, so we used freezegun to mock
datetime.datetime.now
to increment time in a meaningful way:This issue could, of course, be due to freezegun, but we should say that updating our code to
scheduler.every().sunday.do(m)
passed the tests. We think it's something to do withat
and_schedule_next_run
, which is a bit complicated (RE #116).We traced out the scheduler.jobs after each call to
run_pending
and found that next run was not updated correctly when the job was run at its given time, but then was updated when the job ran after its scheduled time, here's the trace:At Sunday, January 1, 2017, 5:45am:
At Sunday, January 1, 2017, 6:00am:
And at Sunday, January 1, 2017, 6:15am:
We're happy to submit a PR - but it would be useful if someone could point us in the right direction!
The text was updated successfully, but these errors were encountered: