mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-06-16 04:00:36 +00:00
celerywyrm: allow broker and result backend from the environment
This allows to easily configure an in-memory transport for tests.
This commit is contained in:
parent
5384e4c470
commit
a659661b24
|
@ -13,10 +13,10 @@ REDIS_BROKER_DB_INDEX = env.int("REDIS_BROKER_DB_INDEX", 0)
|
|||
REDIS_BROKER_URL = env(
|
||||
"REDIS_BROKER_URL",
|
||||
f"redis://:{REDIS_BROKER_PASSWORD}@{REDIS_BROKER_HOST}:{REDIS_BROKER_PORT}/{REDIS_BROKER_DB_INDEX}",
|
||||
)
|
||||
).replace("unix:", "redis+socket:")
|
||||
|
||||
CELERY_BROKER_URL = REDIS_BROKER_URL.replace("unix:", "redis+socket:")
|
||||
CELERY_RESULT_BACKEND = REDIS_BROKER_URL.replace("unix:", "redis+socket:")
|
||||
CELERY_BROKER_URL = env("CELERY_BROKER_URL", REDIS_BROKER_URL)
|
||||
CELERY_RESULT_BACKEND = env("CELERY_RESULT_BACKEND", REDIS_BROKER_URL)
|
||||
|
||||
CELERY_DEFAULT_QUEUE = "low_priority"
|
||||
CELERY_CREATE_MISSING_QUEUES = True
|
||||
|
|
Loading…
Reference in a new issue