mirror of
https://github.com/jwinterm/modoboa.git
synced 2026-10-18 05:51:26 +02:00
Merge pull request #3530 from ntninja/patch-always-use-redis-url
Use `redis.from_url`, rather than the seperate fields in Modoboa policyd
This commit is contained in:
@@ -6,11 +6,7 @@ from django.conf import settings
|
||||
def get_redis_connection(hget_return_type=int) -> redis.Redis:
|
||||
"""Return a client connection to Redis server."""
|
||||
if not getattr(settings, "REDIS_SENTINEL", False):
|
||||
rclient = redis.Redis(
|
||||
host=settings.REDIS_HOST,
|
||||
port=settings.REDIS_PORT,
|
||||
db=settings.REDIS_QUOTA_DB,
|
||||
)
|
||||
rclient = redis.from_url(settings.REDIS_URL)
|
||||
else:
|
||||
sentinel = redis.sentinel.Sentinel(
|
||||
settings.REDIS_SENTINELS, socket_timeout=0.1, db=settings.REDIS_QUOTA_DB
|
||||
|
||||
Reference in New Issue
Block a user