Allow to set a prefix for keys and channels in redis

Set the prefix in `paperless.conf` as `PAPERLESS_REDIS_PREFIX=myprefix`
This commit is contained in:
amo13 2023-08-15 00:05:11 +02:00 committed by shamoon
parent 3e2e485f66
commit 5750a3f119

View File

@ -364,6 +364,7 @@ CHANNEL_LAYERS = {
"hosts": [_CHANNELS_REDIS_URL],
"capacity": 2000, # default 100
"expiry": 15, # default 60
"prefix": os.getenv("PAPERLESS_REDIS_PREFIX", ""),
},
},
}
@ -679,6 +680,7 @@ CELERY_TASK_SEND_SENT_EVENT = True
CELERY_SEND_TASK_SENT_EVENT = True
CELERY_BROKER_CONNECTION_RETRY = True
CELERY_BROKER_CONNECTION_RETRY_ON_STARTUP = True
CELERY_BROKER_TRANSPORT_OPTIONS = {'global_keyprefix': os.getenv("PAPERLESS_REDIS_PREFIX", "")}
CELERY_TASK_TRACK_STARTED = True
CELERY_TASK_TIME_LIMIT: Final[int] = __get_int("PAPERLESS_WORKER_TIMEOUT", 1800)