2021-05-10 14:19:50 -07:00
|
|
|
""" bookwyrm settings and configuration """
|
2021-09-07 13:51:59 -07:00
|
|
|
# pylint: disable=wildcard-import
|
|
|
|
# pylint: disable=unused-wildcard-import
|
2021-05-10 14:19:50 -07:00
|
|
|
from bookwyrm.settings import *
|
2020-03-31 16:31:33 -07:00
|
|
|
|
2023-04-06 01:18:35 -04:00
|
|
|
QUERY_TIMEOUT = env.int("CELERY_QUERY_TIMEOUT", env.int("QUERY_TIMEOUT", 30))
|
|
|
|
|
2022-02-26 10:13:44 -08:00
|
|
|
# pylint: disable=line-too-long
|
2023-07-22 13:27:43 +02:00
|
|
|
REDIS_BROKER_PASSWORD = requests.compat.quote(env("REDIS_BROKER_PASSWORD", ""))
|
2022-01-05 08:27:39 -08:00
|
|
|
REDIS_BROKER_HOST = env("REDIS_BROKER_HOST", "redis_broker")
|
2023-03-18 15:23:51 -04:00
|
|
|
REDIS_BROKER_PORT = env.int("REDIS_BROKER_PORT", 6379)
|
|
|
|
REDIS_BROKER_DB_INDEX = env.int("REDIS_BROKER_DB_INDEX", 0)
|
2023-01-14 15:44:10 -08:00
|
|
|
REDIS_BROKER_URL = env(
|
|
|
|
"REDIS_BROKER_URL",
|
2023-01-14 18:20:37 -08:00
|
|
|
f"redis://:{REDIS_BROKER_PASSWORD}@{REDIS_BROKER_HOST}:{REDIS_BROKER_PORT}/{REDIS_BROKER_DB_INDEX}",
|
2023-01-14 15:44:10 -08:00
|
|
|
)
|
2022-01-05 08:27:39 -08:00
|
|
|
|
2023-01-14 15:44:10 -08:00
|
|
|
CELERY_BROKER_URL = REDIS_BROKER_URL.replace("unix:", "redis+socket:")
|
|
|
|
CELERY_RESULT_BACKEND = REDIS_BROKER_URL.replace("unix:", "redis+socket:")
|
2021-09-07 13:51:59 -07:00
|
|
|
|
2021-09-07 17:11:32 -07:00
|
|
|
CELERY_DEFAULT_QUEUE = "low_priority"
|
2022-03-17 09:57:25 -07:00
|
|
|
CELERY_CREATE_MISSING_QUEUES = True
|
2021-09-07 16:06:54 -07:00
|
|
|
|
2021-03-08 08:49:10 -08:00
|
|
|
CELERY_ACCEPT_CONTENT = ["json"]
|
|
|
|
CELERY_TASK_SERIALIZER = "json"
|
2021-09-07 13:51:59 -07:00
|
|
|
CELERY_RESULT_SERIALIZER = "json"
|
2022-02-26 10:13:44 -08:00
|
|
|
|
|
|
|
CELERY_BEAT_SCHEDULER = "django_celery_beat.schedulers:DatabaseScheduler"
|
|
|
|
CELERY_TIMEZONE = env("TIME_ZONE", "UTC")
|
|
|
|
|
2023-03-07 13:52:02 -05:00
|
|
|
CELERY_WORKER_CONCURRENCY = env("CELERY_WORKER_CONCURRENCY", None)
|
|
|
|
CELERY_TASK_SOFT_TIME_LIMIT = env("CELERY_TASK_SOFT_TIME_LIMIT", None)
|
|
|
|
|
2023-03-18 15:33:24 -04:00
|
|
|
FLOWER_PORT = env.int("FLOWER_PORT", 8888)
|
2020-03-31 16:31:33 -07:00
|
|
|
|
2021-05-10 14:19:50 -07:00
|
|
|
INSTALLED_APPS = INSTALLED_APPS + [
|
2021-03-08 08:49:10 -08:00
|
|
|
"celerywyrm",
|
2020-03-31 16:31:33 -07:00
|
|
|
]
|
|
|
|
|
2021-03-08 08:49:10 -08:00
|
|
|
ROOT_URLCONF = "celerywyrm.urls"
|
2020-03-31 16:31:33 -07:00
|
|
|
|
2021-03-08 08:49:10 -08:00
|
|
|
WSGI_APPLICATION = "celerywyrm.wsgi.application"
|