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
| Option | Type | Default | Description |
|---|---|---|---|
database_url | string | – | Connection string of the PostgreSQL database. |
schema | string | maple | Schema holding the job tables. |
queues | list | ["default"] | Queues this worker takes jobs from. |
concurrency | int | 10 | Jobs run at the same time per worker. |
poll_interval | duration | 5s | How often to look for jobs when no notification arrives. |
retry.max_attempts | int | 25 | Attempts before a job is marked failed. |
retry.backoff | duration | 10s | Wait before the first retry. Doubles with every attempt. |
timeout | duration | 30m | A job running longer is cancelled and retried. |
handler.url | string | – | Your application's endpoint that runs jobs. |
metrics.listen | string | – | Address for the Prometheus metrics. Empty turns them off. |
log.level | string | info | debug, info, warn or error. |