Limit Celery's Redis connections (#1164)

This change adds a `MAX_CELERY_CONNECTIONS` environment variable, which
defaults to `60`.
This commit is contained in:
Kenneth Reitz
2024-07-23 11:40:55 -04:00
committed by GitHub
parent 44aca9f962
commit 562ad647c1
2 changed files with 7 additions and 0 deletions

View File

@@ -254,6 +254,9 @@ CELERY_ACCEPT_CONTENT = ["application/json"]
CELERY_TASK_SERIALIZER = "json"
CELERY_RESULT_SERIALIZER = "json"
CELERY_TIMEZONE = "UTC"
CELERY_BROKER_TRANSPORT_OPTIONS = {
"max_connections": env.int("MAX_CELERY_CONNECTIONS", default=60)
}
CACHES = {
"default": {

View File

@@ -75,3 +75,7 @@ This project uses environment variables to configure certain aspects of the appl
### `CI`
- If set, will set SITE_ID to 1 in `settings.py`.
### `MAX_CELERY_CONNECTIONS`
- If set, will set the maximum number of connections to the Celery in `settings.py`. Defaults to 60.