Mapleloom
Docs / Reference

Configuration

Mapleloom reads its configuration from /etc/mapleloom/mapleloom.toml. Pass --config to point it elsewhere. The file is TOML; every option has a default, so it only needs what you change.

A complete example

# /etc/mapleloom/mapleloom.toml
database_url = "postgres://mapleloom@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 MAPLELOOM_ in front, so retry.max_attempts becomes MAPLELOOM_RETRY_MAX_ATTEMPTS. The environment wins over the file.

All options

OptionTypeDefaultDescription
database_urlstring–Connection string of the PostgreSQL database.
schemastringmapleloomSchema 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.