Skip to content

MongocampJobQueue ​

The job queue of server 3.0, for administrators: one-off jobs (core.enqueue(name, payload, { retries }) on the server) with their state, attempts and last error. Shown as the Queue section of MongocampJobs (hideQueue leaves it out); usable on its own.

vue
<template>
  <MongocampJobQueue :auto-refresh="10" />
</template>
  • List — useMongocampQueue().list, newest first, 25 a page (pageSize) with a pager from the server's count; filters state (pending / running / done / failed) and job name (300 ms debounce), both start at page 1 again. Columns: job (and its dedupe key), state badge (failed = dead letter, red), attempts n / max, when it runs or finished, last error (one line, full text in the details).
  • Retry — failed jobs only (a dead letter stays failed until it is retried or deleted); Delete — every job but a running one, after a confirmation. An unknown job (404) is reported as gone; a job that is running (server 3.1: 409, code 4094) is not deleted and the toast says so. Both reload the list and emit changed.
  • Details — a drawer with id, created time, attempts, the full last error and the payload (only here: a payload may carry what the job needs, for example an auth mail's link).
  • Done jobs are removed by the server after QUEUE_KEEP_DONE (7 days). A known non-administrator sees the admin-only state and nothing is asked.

Props ​

PropTypeDefaultDescription
autoRefreshnumber0Reload every N seconds (useMongocampAutoRefresh; a failed background reload keeps the rows). MongocampJobs passes its own.
pageSizenumber25Rows per page.
hideHeading / hideRefreshbooleanfalseLeave out the heading / the reload button.

toolbar slot after the reload button; refresh() exposed; changed after a retry or delete.

Released under the MIT License.