mirror of
https://github.com/tubearchivist/tubearchivist.git
synced 2025-03-14 09:50:12 +00:00
parse unix connection string for redis socket
This commit is contained in:
parent
a68798842b
commit
73bd392488
@ -5,12 +5,21 @@ import os
|
|||||||
from celery import Celery
|
from celery import Celery
|
||||||
from common.src.env_settings import EnvironmentSettings
|
from common.src.env_settings import EnvironmentSettings
|
||||||
|
|
||||||
|
|
||||||
|
def con_parser():
|
||||||
|
"""allow for unix socket parsing"""
|
||||||
|
redis_con = EnvironmentSettings.REDIS_CON
|
||||||
|
if redis_con.startswith("unix://"):
|
||||||
|
redis_con = EnvironmentSettings.REDIS_CON.replace(
|
||||||
|
"unix://", "redis+socket://", 1
|
||||||
|
)
|
||||||
|
|
||||||
|
return redis_con
|
||||||
|
|
||||||
|
|
||||||
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings")
|
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings")
|
||||||
app = Celery(
|
app = Celery(
|
||||||
"tasks",
|
"tasks", broker=con_parser(), backend=con_parser(), result_extended=True
|
||||||
broker=EnvironmentSettings.REDIS_CON,
|
|
||||||
backend=EnvironmentSettings.REDIS_CON,
|
|
||||||
result_extended=True,
|
|
||||||
)
|
)
|
||||||
app.config_from_object(
|
app.config_from_object(
|
||||||
"django.conf:settings", namespace=EnvironmentSettings.REDIS_NAME_SPACE
|
"django.conf:settings", namespace=EnvironmentSettings.REDIS_NAME_SPACE
|
||||||
|
Loading…
Reference in New Issue
Block a user