diff options
author | Roey Prat <roey.prat@redislabs.com> | 2018-11-04 10:26:27 +0200 |
---|---|---|
committer | Roey Prat <roey.prat@redislabs.com> | 2018-11-04 10:29:05 +0200 |
commit | bf15bd6bb6de06d2da8727308bd9d91ff584b514 (patch) | |
tree | d922c2217dc575ebdbff8e1902dc14ab350cf75b /redis/client.py | |
parent | 7a8a85245d2e55c2c97290175bd6d6f98976ff5f (diff) | |
download | redis-py-bf15bd6bb6de06d2da8727308bd9d91ff584b514.tar.gz |
Remove reason arg from client_unblock. Use boolean 'error' arg instead.
Diffstat (limited to 'redis/client.py')
-rwxr-xr-x | redis/client.py | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/redis/client.py b/redis/client.py index 416d34b..9a16c8e 100755 --- a/redis/client.py +++ b/redis/client.py @@ -717,17 +717,16 @@ class StrictRedis(object): "Sets the current connection name" return self.execute_command('CLIENT SETNAME', name) - def client_unblock(self, client_id, reason=None): + def client_unblock(self, client_id, error=False): """ - Unblocks a connection by its client id - - The ``reason`` argument, if set to ``'error'``, unblocks the client - with a special error message. When set to ``'timeout'`` or if not set, - the client is unblocked using the regular timeout mechanism. + Unblocks a connection by its client id. + If ``error`` is True, unblocks the client with a special error message. + If ``error`` is False (default), the client is unblocked using the + regular timeout mechanism. """ args = ['CLIENT UNBLOCK', int(client_id)] - if reason is not None and isinstance(reason, str): - args.append(reason) + if error: + args.append(Token.get_token('ERROR')) return self.execute_command(*args) def config_get(self, pattern="*"): |