Skip to content

jobs

Persistence and operator tooling for background jobs registered via r.job(...). Every job execution writes directly into store_job_runs (current status + duration) and store_job_run_logs (per-line log rows) from the BullMQ callbacks — no event stream in between (#2243). A daily retention-cleanup job deletes runs (and their logs) older than retentionDays; an hourly stale-run-sweep job marks runs stuck at status running past staleRunTimeoutHours as failed (#2246 — a crashed worker never fires the completion callback, so nothing else ever revisits the row). Exposes jobs:write:trigger (manual run) and jobs:write:retry (operator retry of a failed run), plus jobs:query:list, jobs:query:details, and jobs:query:catalog (manual jobs) for the operator UI. A job that declares tenantVisibleFailure also records its last failed attempt per tenant and subject in store_tenant_job_failures, which the tenant itself reads through jobs:query:failures — a translation key only, never the provider’s message (fw#3079). A job that declares tenantVisibleRun also keeps its run state per tenant and subject in store_tenant_job_runs (queued, running, plus the latest completed or failed run, no payload, error text or logs), which the tenant reads through jobs:query:tenant-runs (fw#3616); the stale-run sweep fails its stuck running rows and drops queued rows older than retentionDays.

jobs feature preview

The write commands this feature provides (Provides).

flowchart TB
  n_jobs["jobs"]
  subgraph how_provides["Provides"]
    n_cmd_jobs_write_consumer_disable(["consumer-disable"])
    n_cmd_jobs_write_consumer_enable(["consumer-enable"])
    n_cmd_jobs_write_consumer_restart(["consumer-restart"])
    n_cmd_jobs_write_consumer_skip(["consumer-skip"])
    n_cmd_jobs_write_retry(["retry"])
    n_cmd_jobs_write_trigger(["trigger"])
  end
  n_jobs --> n_cmd_jobs_write_consumer_disable
  n_jobs --> n_cmd_jobs_write_consumer_enable
  n_jobs --> n_cmd_jobs_write_consumer_restart
  n_jobs --> n_cmd_jobs_write_consumer_skip
  n_jobs --> n_cmd_jobs_write_retry
  n_jobs --> n_cmd_jobs_write_trigger

Provides — write commands this feature registers (dispatch them through the command bus):

Start with apps-admin-console for a step-by-step walkthrough with runnable code and integration tests.

  • Requires: none
  • Activation: always on (not toggleable)