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 dedupekey), state badge (failed = dead letter, red), attemptsn / max, when it runs or finished, last error (one line, full text in the details). - Retry — failed jobs only (a dead letter stays
faileduntil 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, code4094) is not deleted and the toast says so. Both reload the list and emitchanged. - 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
| Prop | Type | Default | Description |
|---|---|---|---|
autoRefresh | number | 0 | Reload every N seconds (useMongocampAutoRefresh; a failed background reload keeps the rows). MongocampJobs passes its own. |
pageSize | number | 25 | Rows per page. |
hideHeading / hideRefresh | boolean | false | Leave out the heading / the reload button. |
toolbar slot after the reload button; refresh() exposed; changed after a retry or delete.