We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
get_valkey_connection
1 parent 0a87644 commit 772b417Copy full SHA for 772b417
django_valkey/__init__.py
@@ -2,7 +2,7 @@
2
__version__ = ".".join(map(str, VERSION))
3
4
5
-def get_valkey_connection(alias="default", write=True):
+def get_valkey_connection(alias="default", write=True, key=None):
6
"""
7
Helper used for obtaining a raw valkey client.
8
@@ -18,4 +18,7 @@ def get_valkey_connection(alias="default", write=True):
18
if not hasattr(cache.client, "get_client"):
19
raise NotImplementedError(error_message)
20
21
+ if hasattr(cache.client, "get_server_name"):
22
+ return cache.client.get_client(key=key)
23
+
24
return cache.client.get_client(write)
0 commit comments