diff options
author | Peter van Dijk <peter.van.dijk@powerdns.com> | 2016-11-15 00:40:07 +0100 |
---|---|---|
committer | Andy McCurdy <andy@andymccurdy.com> | 2019-12-29 14:05:24 -0800 |
commit | dca7bd40a3a5d0c0853fe2befe706e214407697b (patch) | |
tree | 1733abbf899beda9a4cf96ba7c294fede28d6f53 /redis/client.py | |
parent | a41465e17df3448656da45141b7b14de9d1434eb (diff) | |
download | redis-py-dca7bd40a3a5d0c0853fe2befe706e214407697b.tar.gz |
Allow setting client_name during connection construction.
Client instances and Connection pools now accept "client_name" as an optional
argument. If supplied, all connections created will be named via
CLIENT SETNAME once the connection to the server is established.
Diffstat (limited to 'redis/client.py')
-rwxr-xr-x | redis/client.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/redis/client.py b/redis/client.py index 0486022..eb1ccf1 100755 --- a/redis/client.py +++ b/redis/client.py @@ -684,7 +684,7 @@ class Redis(object): ssl=False, ssl_keyfile=None, ssl_certfile=None, ssl_cert_reqs='required', ssl_ca_certs=None, max_connections=None, single_connection_client=False, - health_check_interval=0): + health_check_interval=0, client_name=None): if not connection_pool: if charset is not None: warnings.warn(DeprecationWarning( @@ -706,6 +706,7 @@ class Redis(object): 'retry_on_timeout': retry_on_timeout, 'max_connections': max_connections, 'health_check_interval': health_check_interval, + 'client_name': client_name } # based on input, setup appropriate connection args if unix_socket_path is not None: |