Oko/Docs

Command reference

oko journal claim

Claims one job for at-most-once execution in the executor's journal, kept in the shared Oko database so a job claimed on one machine is claimed on every machine.

Invocation#

Command
oko journal claim <job> --journal NAME --definition TEXT

Inputs and options#

  • --journal: the executor's journal name, lowercase letters, digits and hyphens (`routines`, `slack-executions`); the job id and the definition it runs. The verb comes first, as in every oko group: a flag written before it (`oko journal --journal NAME claim …`) leaves no verb, oko reads the default `list`, and the call is refused with `oko journal takes claim, complete, fail, undelivered or delivered; got list`.

Output and state effect#

  • Prints `{claimed: true}` for a fresh claim, or `{claimed: false, receipt}` when the same definition already completed, so the receipt is delivered again instead of the work repeated.

Refusals and safe exits#

  • `oko journal requires --journal <text>`, `oko journal claim requires <id>`, `oko journal claim requires --definition <text>` (exit 2). Every journal refusal reads `Execution journal refused the operation: <detail>`: `journal name <name> is not lowercase letters, digits and hyphens`; `job <job> already belongs to another definition`; `job <job> already started: <failure or: the prior attempt's completion is unknown>. Inspect its receipts; it will not execute twice automatically.`; `job <job> was neither claimed nor found; the claim is unknown`; the shared database refusals of `oko database check`.

CLI reference#