We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent dfc7898 commit 4017cf5Copy full SHA for 4017cf5
aredis_om/connections.py
@@ -9,11 +9,9 @@
9
def get_redis_connection(**kwargs) -> aioredis.Redis:
10
# If someone passed in a 'url' parameter, or specified a REDIS_OM_URL
11
# environment variable, we'll create the Redis client from the URL.
12
- url = kwargs.pop("url", URL)
13
- if url:
14
- return aioredis.Redis.from_url(url, **kwargs)
15
-
+ if not kwargs.get("url", None) and URL:
+ kwargs["url"] = URL
16
# Decode from UTF-8 by default
17
- if "decode_responses" not in kwargs:
+ if not kwargs.get("decode_responses", None):
18
kwargs["decode_responses"] = True
19
- return aioredis.Redis(**kwargs)
+ return aioredis.from_url(**kwargs)
0 commit comments