[BUG] - Time reported by NextRun
when running WithSingletonMode
and WithStartDateTime
incorrect
#704
Labels
bug
Something isn't working
Describe the bug
The time reported by
NextRun
isn't right when runningWithSingletonMode
andWithStartDateTime
. For instance, suppose we have a job that starts at timet
(in the future) and repeats with some intervali
. When callingNextRun
at some timet_i
that is beforet
, theNextRun
is reported correctly. However, after the job is run for the first time, the time reported byNextRun
ist + 2i
when it should bet + i
instead. Here's a table depicting the pattern I observedNextRun
is called0 -> t
t
✅t
t -> t + i
t + 2i
❌t + i
t + i -> t + 2i
t + 4i
❌t + 2i
To Reproduce
Here's a test that I wrote in the
job_test.go
file:Version
v2.2.9
Expected behavior
I expect that these two asserts:
should not fail. I also modified this test to see what happens when more jobs are run:
Fortunately what is working: my job is running at the specified interval provided to
DurationJob
.The text was updated successfully, but these errors were encountered: