SextantDocs
v2.4latest
v2.4latestv1.9legacy

Switching keeps you on the same page when it exists in the other version.

On this page

server and worker

Reference for sextant server and sextant worker, the two long-running commands, with every flag and its config key.

Updated CLI reference Version v2.4

sextant server

Starts the HTTP API, the scheduler and, if configured, the metrics endpoint.

Shell
sextant server --config sextant.toml --listen 0.0.0.0:7420
--config, -cpath optional default sextant.toml
Config file. Also SEXTANT_CONFIG.
--listenaddress optional default 127.0.0.1:7420
Overrides server.listen.
--store-dsnstring optional
Overrides store.dsn. Also SEXTANT_STORE_DSN.
--no-schedulerboolean optional
Run the API only. Use it when another replica holds the scheduler.
--migrateboolean optional
Apply pending store migrations before listening. Off by default in production.
--log-levelstring optional default info
debug, info, warn or error.

The server stops on SIGINT or SIGTERM: it finishes in-flight requests (up to 15 seconds) and releases the scheduler lock.

sextant worker

Runs jobs whose handlers are declared as commands in the config. For handlers inside your own application, use an SDK instead.

Shell
sextant worker --queues default,emails --concurrency 20
--queues, -qlist optional default default
Queues to pull from, comma-separated.
--concurrencyinteger optional default 10
Jobs this process runs at once. The queue’s own concurrency still applies across all workers.
--config, -cpath optional default sextant.toml
Read for [handlers.*]. The worker does not need the store settings.
--leaseduration optional default 30s
Lease length. The worker renews it at a third of this interval.
--shutdown-timeoutduration optional default 30s
How long to wait for running jobs after SIGTERM.
--namestring optional default hostname
Name reported in workers list.

How command handlers run

For each job the worker starts the configured exec command and:

  • writes the payload as JSON on standard input, then closes it;
  • sets SEXTANT_JOB_ID, SEXTANT_QUEUE, SEXTANT_ATTEMPT and SEXTANT_RUN_AT in the environment;
  • captures the last 64 KiB of standard output and standard error as the attempt’s output;
  • interprets the exit code.
Exit code Result
0 Success
78 Permanent failure: the job becomes dead without retrying
anything else Failure: retried according to the queue’s policy

On timeout or cancellation the worker sends SIGTERM, waits cancel_grace (10 seconds), then SIGKILL.