Skip to content

Commit fd2cca5

Browse files
committed
fix: use shared cache backend across WSGI workers
Signed-off-by: Keshav Priyadarshi <git@keshav.space>
1 parent 774a20f commit fd2cca5

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

vulnerablecode/settings.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -402,6 +402,18 @@
402402
}
403403

404404

405+
vcio_redis_host = env.str("VULNERABLECODE_REDIS_HOST", default=None)
406+
vcio_redis_port = env.str("VULNERABLECODE_REDIS_PORT", default=None)
407+
408+
if vcio_redis_host and vcio_redis_port:
409+
CACHES = {
410+
"default": {
411+
"BACKEND": "django.core.cache.backends.redis.RedisCache",
412+
"LOCATION": f"redis://{vcio_redis_host}:{vcio_redis_port}",
413+
}
414+
}
415+
416+
405417
# FederatedCode integration
406418

407419
FEDERATEDCODE_VULNERABILITIES_REPO = env.str(

0 commit comments

Comments
 (0)