Closed agateblue closed 2 years ago
Thx a lot, i added some more explicit calls to set_current(force=?)
as we toggled the default.
The force=
was just introduced anyway, so no chance it's used in the wild moreover when it's more an internal API switch that something users will play around.
Yeah that's what I thought too, I wouldn't be surprised to be the only one encountering this :smile:
@kiorky I've started a PR that includes a simple test case for this issue and a proposed solution
The test case fails on master, passes on v1.2.0. As far as I can tell, during https://github.com/kiorky/croniter/commit/1ea781aa1936214088fa6451c5d62537045869dd, the
set_current()
method signature slightly changed, including an optionalforce
parameter with a default toFalse
.When calling
set_current(start_time)
beforeget_next()
, which Procrastinate does, without specifyingforce
, theset_current()
call is basically a no-op, which causes the change of behaviour.My suggested fix is to switch the default value for the
force
argument toTrue
. This fixes the test, restores backward compatibility, and also makes more sense from a UX point of view IMHO: if you're callingset_current()
with a non nullstart_time
, you most likely do want it to be used :)