Maple
Docs / Reference

Configuration

Maple reads its configuration from /etc/maple/maple.toml. Pass --config to use another file. The file is TOML; every option has a default, so it only needs what you change.

Example

# /etc/maple/maple.toml
database_url = "postgres://maple@localhost/app"
queues = ["default", "mail"]
concurrency = 20
timeout = "5m"

[handler]
url = "http://127.0.0.1:8080/jobs"

[metrics]
listen = "127.0.0.1:9187"

Environment variables

Every option can also be set in the environment: write the key in upper case, replace dots with underscores and put MAPLE_ in front, so retry.max_attempts becomes MAPLE_RETRY_MAX_ATTEMPTS. The environment wins over the file.

Options

OptionTypeDefaultDescription
database_urlstring–Connection string of the PostgreSQL database.
schemastringmapleSchema holding the job tables.
queueslist["default"]Queues this worker takes jobs from.
concurrencyint10Jobs run at the same time per worker.
poll_intervalduration5sHow often to look for jobs when no notification arrives.
retry.max_attemptsint25Attempts before a job is marked failed.
retry.backoffduration10sWait before the first retry. Doubles with every attempt.
timeoutduration30mA job running longer is cancelled and retried.
handler.urlstring–Your application's endpoint that runs jobs.
metrics.listenstring–Address for the Prometheus metrics. Empty turns them off.
log.levelstringinfodebug, info, warn or error.