Closed kbrock closed 1 year ago
update:
update:
update:
update:
Wait#start
(vs rubocop encouraged separate method)Updates:
timecop
gem)Can you describe the problem you are trying to solve in the OP? It;'s hard to understand what problem/feature this is trying to solve.
Saw the little refs in the OP - are those new features being added here?
update:
wait_until
Change Wait#running?
I feel
running?
should read the state to see if the task is complete but should not change the state.This change was also introduced to be reusable by
Task#wait
.Before
running?
checks if we have passed the amount of time necessary. Once it is no longer running, this method sets thestate["EndTime"]
.After
start
sets the target time when this will end.running?
just checksTime.now
agains the predefined value.running?
no longer modifiesstate
sleep
orMiqQueue#deliver_on
.Wait#SecondsPath
wait refThe existing
Seconds
parameter reads the wait time out of the payload. The newSecondsPath
reads the wait time out of theinput
.Wait#Timestamp
,Wait#TimestampPath
While the existing
Seconds
parameter is a delta, and the newTimestamp
parameter is an absolute time. TheTimestampPath
parameter is the equivalent, but the value comes from theinput
.The implementation for
Timestamp
andTimestampPayload
are not very different fromSeconds
. wait refTask#retry
A retrier specifies how many times to re-run a Task after it fails. But the current code does not delay the retry. More information on the retry delay logic can be found in the ref
Before
A task retry does not introduce a delay so there is no incremental backoff. The retrier does allow you to define it, but it is not used. You will notice the
TODO
removed from this PR.After
We do a non-blocking sleep similar to
Wait
when a task has a failure. Since theTask#wait
implementation is based uponSleep#wait
, I bundled them together.Removed
Extracted
workflow#wait_until
to another PR.