Run every minute at fixed rate, no drift.#116
Conversation
|
I've added some more validation as well on the argument to .at() |
|
Hi, I'm really looking forward to this update. Is there an ETA when it will be branched out to PIP3? |
|
I like this – thanks for the PR @dgrant 😃 Let's aim for getting this into the next release (0.5.0) (cc @PatrickMurray). In terms of next steps we'd need to:
I can take on some of that when I prep the release but if you could go ahead and make these changes here in the PR that would be super. Thanks! |
|
Just updating now. One concern in some of these asserts will break old code using this module. Assuming people are using fixed versioning in their requirements.txt they'll be okay... but it's still not nice to break them. Perhaps we could provide warnings? One example is that it used to be possible to say:
That doesn't really make sense though. What they really mean is:
...or they didn't mean "hourly" here? they meant one-time instead? Anyways, previously the first one was allowed, but now I'm asserting. |
|
Can this be merged? |
|
Hey there, sorry for remaining silent on this for so long. My concern here is that the I don't have a lot of time to spend on refactoring at the moment and I don't feel comfortable making lasting changes that create more work for me as the maintainer. I'd be open for suggestions on how the scheduling code can be refactored. |
|
@dbader That _schedule_next_run method is just barely over one-screen long for me on this PR, hardly a "beast" IMO. I just shortened it a bit :-) |
|
I'm willing to help refactor things some more in the future, but I'd prefer that this gets merged in. I think think this makes things better and more complete, and of course all old tests pass. I don't see a reason to hold this up. Yes, I agree that some refactoring would be nice, but I don't think it makes sense to wait for some refactoring to happen. Any refactoring that touches this code will cause conflicts and extra unnecessary work. I also don't think this makes anything any worse. |
1991b22 to
0c123bb
Compare
015a5ad to
b50fe28
Compare
|
I've rebased and squashed this. |
b50fe28 to
1c7e832
Compare
|
Any update to this? Have been using dgrant's branch with success. It would be great to get it merged in. |
Fixed flake errors and refactored code to be a bit cleaner.
added another test case for unit=minutes, and .at('::00') where the current time is *:*:30
Add test case for running at particular time in HH:MM:SS
Updated docstrings, readme, fax, and history, and added a bit more testing
fixed syntax/style issues
reformat docstring
1c7e832 to
463917d
Compare
Trying to extend .at() to apply to this case:
every().minute.at('::30').do(mock_job)