Update Job Status in Tracking SQLite Database
Source:R/job_tracking_functions.R
update_tracked_job_status.Rd
Updates the status of a specific job in a tracking database, optionally cascading failure status to downstream jobs.
Usage
update_tracked_job_status(
sqlite_db = NULL,
job_id = NULL,
status,
cascade = FALSE,
exclude = NULL
)
Arguments
- sqlite_db
Character string. Path to the SQLite database file used for job tracking.
- job_id
Character string or numeric. ID of the job to update. If numeric, it will be coerced to a string.
- status
Character string. The job status to set. Must be one of:
"QUEUED"
,"STARTED"
,"FAILED"
,"COMPLETED"
,"FAILED_BY_EXT"
.- cascade
Logical. If
TRUE
, and thestatus
is a failure type ("FAILED"
or"FAILED_BY_EXT"
), the failure is recursively propagated to child jobs not listed inexclude
.- exclude
Character or numeric vector. One or more job IDs to exclude from cascading failure updates.
Details
The function updates both the job status
and a timestamp corresponding to the status type:
"QUEUED"
-> updatestime_submitted
"STARTED"
-> updatestime_started
"FAILED"
,"COMPLETED"
, or"FAILED_BY_EXT"
-> updatestime_ended
If cascade = TRUE
, and the status is "FAILED"
or "FAILED_BY_EXT"
, any dependent jobs (as determined
via get_tracked_job_status()
) will be recursively marked as "FAILED_BY_EXT"
, unless their status is already
"FAILED"
or they are listed in exclude
.
If sqlite_db
or job_id
is invalid or missing, the function fails silently and returns NULL
.