Manages pipeline job lifecycle in the database for real-time progress monitoring. The UI notification module polls these records to display active processing pipelines to users.
Usage
job_add(artist, artwork, name = "Untitled.", cn = NULL)
job_update(id = NULL, status = NULL, msg = NULL, progress = NULL, cn = NULL)
job_get(id = NULL, cn = NULL)Arguments
- artist
Character. Artist UUID identifying who owns this artwork.
- artwork
Character. Artwork UUID being processed.
- name
Character. Artwork title for display in the notification dropdown.
- cn
DBI connection. Optional; if NULL, creates and closes connection internally.
- id
Integer. Job ID (primary key) returned by job_add(). Used to update progress and retrieve status.
- status
Character. Current job state for UI display and workflow control. Valid values: "started", "running", "error", "warning", "success".
- msg
Character. Human-readable status message shown in logs and UI. Should describe current pipeline step or error details.
- progress
Integer 0-100. Percentage complete for progress bar display. Setting to 100 also sets completed_utc timestamp.
Value
Integer. The newly created job ID.
Integer. The job ID (passthrough for chaining).
data.table. Single row from pipeline.jobs table, or NULL if id is NULL.
Details
Jobs track artwork processing from start to completion, including: - Progress percentage for UI progress bars - Status messages for debugging failures - Timestamps for auditing and performance analysis
The pipeline.jobs table serves as the coordination point between background processing (run_pipeline) and the Shiny UI (pl_notification_server).
Functions
job_add(): Add new pipeline jobjob_update(): Update existing pipeline job statusjob_get(): Get pipeline job by ID
See also
Other pipeline orchestration:
pl-run
