TaskManager
Configures how background tasks are retried after transient failures.
This object can be configured from the WebUI under Settings › Task Manager
Fields
Section titled “Fields”strategy
Section titled “strategy”Type:
TaskRetryStrategy· requiredStrategy used to compute the delay before a task that failed with a transient error is retried
alertAfter
Section titled “alertAfter”Type:
UnsignedInt· default:5· min: 1Number of failed attempts after which a task is reported as stalled; stalled tasks keep retrying with the configured strategy
JMAP API
Section titled “JMAP API”The TaskManager singleton is available via the urn:stalwart:jmap capability.
x:TaskManager/get
Section titled “x:TaskManager/get”This is a standard Foo/get method as defined in RFC 8620, Section 5.1.
For singletons, the ids argument should be the literal singleton (or null to return the single instance).
This method requires the sysTaskManagerGet permission.
curl -X POST https://mail.example.com/jmap/ \ -H 'Authorization: Bearer $TOKEN' \ -H 'Content-Type: application/json' \ -d '{ "methodCalls": [ [ "x:TaskManager/get", { "ids": [ "singleton" ] }, "c1" ] ], "using": [ "urn:ietf:params:jmap:core", "urn:stalwart:jmap" ] }'x:TaskManager/set
Section titled “x:TaskManager/set”This is a standard Foo/set method as defined in RFC 8620, Section 5.3.
For singletons, only the update argument with id singleton is accepted; create and destroy arguments are rejected.
This method requires the sysTaskManagerUpdate permission.
curl -X POST https://mail.example.com/jmap/ \ -H 'Authorization: Bearer $TOKEN' \ -H 'Content-Type: application/json' \ -d '{ "methodCalls": [ [ "x:TaskManager/set", { "update": { "singleton": { "strategy": { "@type": "ExponentialBackoff" } } } }, "c1" ] ], "using": [ "urn:ietf:params:jmap:core", "urn:stalwart:jmap" ] }'stalwart-cli wraps the same JMAP calls. See the CLI reference for installation, authentication, and general usage.
stalwart-cli get TaskManagerUpdate
Section titled “Update”stalwart-cli update TaskManager --field strategy='{"@type":"ExponentialBackoff"}'Nested types
Section titled “Nested types”TaskRetryStrategy
Section titled “TaskRetryStrategy”Retry strategy for failed tasks.
ExponentialBackoff: Exponential backoff. Carries the fields ofTaskRetryStrategyBackoff.FixedDelay: Fixed delay. Carries the fields ofTaskRetryStrategyFixed.
TaskRetryStrategyBackoff
Section titled “TaskRetryStrategyBackoff”Exponential backoff retry strategy settings.
factor
Section titled “factor”Type:
Float· default:2.0· min: 1Backoff factor for calculating retry delays
initialDelay
Section titled “initialDelay”Type:
Duration· default:60000Initial delay before retrying a failed task
maxDelay
Section titled “maxDelay”Type:
Duration· default:21600000Maximum delay between retry attempts
jitter
Section titled “jitter”Type:
Boolean· default:trueWhether to apply jitter to the retry delay to avoid thundering herd problem
TaskRetryStrategyFixed
Section titled “TaskRetryStrategyFixed”Fixed delay retry strategy settings.
Type:
Duration· default:300000Fixed delay before retrying a failed task