shigoto_config (shigoto v1.9.10)
View SourceConfiguration access for Shigoto. Reads from application env.
Summary
Functions
Days to keep archived jobs before permanent deletion. Default: 90.
Cron job entries. Each is {Name, Schedule, Worker, Args} or
{Name, Schedule, Worker, Args, #{timezone => Timezone}}.
AES-256-GCM encryption key for job args/meta. Returns undefined if not configured.
Ordered list of encryption keys (newest first) for key rotation. Default: [].
Queues that use fair partition-based claiming. Default: [] (all use standard claiming).
Fanout queues — every node processes every job. Format:
[{QueueName, Concurrency, Opts}] where Opts may include
window (seconds, default 120). Default: [].
Heartbeat interval in milliseconds for executing jobs. Default: 30000.
Load shedding config. Default: undefined (disabled).
Global middleware chain applied to all jobs. Default: [].
Database connection config for LISTEN/NOTIFY. Returns undefined if not configured.
Poll interval in milliseconds. Default: 5000.
The minato pool name for job storage. Set repo for Kura-based apps or pool for a pool of its own.
Days to keep completed/discarded jobs before archiving. Default: 14.
Queue weight config. Map of queue name to weight. Default: #{} (equal weight).
Configured queue names and concurrency. Default: [{<<"default">>, 10}].
Milliseconds to wait for in-flight jobs during shutdown. Default: 15000.
Stager interval in milliseconds for surfacing newly-due scheduled/retryable jobs. Default: 1000.
Testing mode for insert/1,2 and insert_all/1,2. Default: disabled (normal
production behaviour — jobs are persisted and run by queue workers).
Functions
-spec archive_after_days() -> pos_integer().
Days to keep archived jobs before permanent deletion. Default: 90.
-spec cron_entries() -> list().
Cron job entries. Each is {Name, Schedule, Worker, Args} or
{Name, Schedule, Worker, Args, #{timezone => Timezone}}.
Timezone may be:
utc(the default when omitted)- an integer hour offset, e.g.
2or-5 - a
"+/-N"or"UTC"binary, e.g.<<"+2">> - a named IANA zone, e.g.
<<"Europe/Stockholm">>, resolved (with DST) for each instant against the operating system's time zone database
-spec encryption_key() -> binary() | undefined.
AES-256-GCM encryption key for job args/meta. Returns undefined if not configured.
-spec encryption_keys() -> [binary()].
Ordered list of encryption keys (newest first) for key rotation. Default: [].
-spec fair_queues() -> [binary()].
Queues that use fair partition-based claiming. Default: [] (all use standard claiming).
-spec fanout_queues() -> [{binary(), pos_integer(), map()}].
Fanout queues — every node processes every job. Format:
[{QueueName, Concurrency, Opts}] where Opts may include
window (seconds, default 120). Default: [].
-spec heartbeat_interval() -> pos_integer().
Heartbeat interval in milliseconds for executing jobs. Default: 30000.
-spec load_shedding() -> map() | undefined.
Load shedding config. Default: undefined (disabled).
-spec middleware() -> [shigoto_middleware:middleware()].
Global middleware chain applied to all jobs. Default: [].
-spec notifier_config() -> map() | undefined.
Database connection config for LISTEN/NOTIFY. Returns undefined if not configured.
-spec poll_interval() -> pos_integer().
Poll interval in milliseconds. Default: 5000.
-spec pool() -> atom().
The minato pool name for job storage. Set repo for Kura-based apps or pool for a pool of its own.
-spec prune_after_days() -> pos_integer().
Days to keep completed/discarded jobs before archiving. Default: 14.
-spec queue_weights() -> #{binary() => pos_integer()}.
Queue weight config. Map of queue name to weight. Default: #{} (equal weight).
-spec queues() -> [{binary(), pos_integer()}].
Configured queue names and concurrency. Default: [{<<"default">>, 10}].
-spec shutdown_timeout() -> pos_integer().
Milliseconds to wait for in-flight jobs during shutdown. Default: 15000.
-spec stage_interval() -> pos_integer().
Stager interval in milliseconds for surfacing newly-due scheduled/retryable jobs. Default: 1000.
-spec testing_mode() -> disabled | inline | manual.
Testing mode for insert/1,2 and insert_all/1,2. Default: disabled (normal
production behaviour — jobs are persisted and run by queue workers).
inline executes each inserted job synchronously in the calling process and
keeps no database row; manual captures inserted jobs in a process-local buffer
for shigoto_testing assertions without persisting or executing them. Both are
strictly for tests: they change persistence, so arming them requires TWO keys —
application:set_env(shigoto, testing, inline), %% or manual
application:set_env(shigoto, testing_confirm_no_persistence, true).A non-disabled testing value WITHOUT the confirmation key does NOT arm the
mode: it falls back to the real persisted path and logs an error, so a testing
config that leaks into production fails safe and loud rather than silently
dropping jobs.