Fetch times for tasks at points in their life cycle. For each
task returns the time of submission, starting and completion (not
necessarily successfully; this includes errors and interruptions).
If a task has not reached a point yet (e.g., submitted but not
run, or running but not finished) the time will be NA
). Times
are returned in unix timestamp format in UTC; you can use
redux::redis_time_to_r to convert them to a POSIXt object.
Arguments
- task_ids
A vector of task ids
- follow
Optional logical, indicating if we should follow any redirects set up by doing rrq_task_retry. If not given, falls back on the value passed into the controller, the global option
rrq.follow
, and finallyTRUE
. Set toFALSE
if you want to return information about the original task, even if it has been subsequently retried.- controller
The controller to use. If not given (or
NULL
) we'll use the controller registered withrrq_default_controller_set()
.
Value
A matrix of times, with row names corresponding to task ids. We may change this to a data.frame at some point in the future.
Examples
obj <- rrq_controller("rrq:example")
t <- rrq_task_create_expr(Sys.sleep(3), controller = obj)
rrq_task_times(t, controller = obj)
#> submit start complete moved
#> 836d72016a08daaf4030653f921f40ff 1726673811 1726673811 NA NA
rrq_task_wait(t, controller = obj)
#> [1] TRUE
rrq_task_times(t, controller = obj)
#> submit start complete moved
#> 836d72016a08daaf4030653f921f40ff 1726673811 1726673811 1726673814 NA