Celery¶
Requires the celery extra.
rn_forge.django.celery
¶
Celery app factory and retryable-task defaults.
RETRYABLE_TASK_KWARGS = {'autoretry_for': (Exception,), 'retry_backoff': True, 'retry_kwargs': {'max_retries': 5}}
module-attribute
¶
Spread into @shared_task(**RETRYABLE_TASK_KWARGS): exponential backoff, five retries.
A plain dict rather than a decorator, and its exact shape is asserted by a test — consumers spread it directly, so a silent change here changes their retry behaviour.
make_app(name, *, config_source='django.conf:settings', namespace='CELERY', autodiscover=True)
¶
Return a Celery app configured from Django settings.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
The app's main module name. |
required |
config_source
|
str
|
What |
'django.conf:settings'
|
namespace
|
str
|
The settings prefix: |
'CELERY'
|
autodiscover
|
bool
|
Look for |
True
|