mirror of
https://github.com/django-q2/django-q2.git
synced 2026-10-03 23:58:11 +08:00
ability to use a Redis connection URI - closes #402
This commit is contained in:
@@ -59,4 +59,6 @@ class Redis(Broker):
|
||||
def get_connection(list_key=Conf.PREFIX):
|
||||
if django_redis and Conf.DJANGO_REDIS:
|
||||
return django_redis.get_redis_connection(Conf.DJANGO_REDIS)
|
||||
if isinstance(Conf.REDIS, str):
|
||||
return redis.from_url(Conf.REDIS)
|
||||
return redis.StrictRedis(**Conf.REDIS)
|
||||
|
||||
Reference in New Issue
Block a user