diff options
author | Chayim <chayim@users.noreply.github.com> | 2021-07-25 09:04:15 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-25 09:04:15 +0300 |
commit | 88e5bd8938006a6e7bcc626048a9cd4572bbac68 (patch) | |
tree | 2a5e92594e297bf9695173732f06acbf6aa6ff2a | |
parent | 57cf7ffc1fbaca2f17d03de38ee19e8af48ac153 (diff) | |
download | redis-py-88e5bd8938006a6e7bcc626048a9cd4572bbac68.tar.gz |
support for client unpause (#1512)
-rwxr-xr-x | redis/client.py | 6 | ||||
-rw-r--r-- | tests/test_commands.py | 4 |
2 files changed, 10 insertions, 0 deletions
diff --git a/redis/client.py b/redis/client.py index f822926..db4778c 100755 --- a/redis/client.py +++ b/redis/client.py @@ -1300,6 +1300,12 @@ class Redis: raise DataError("CLIENT PAUSE timeout must be an integer") return self.execute_command('CLIENT PAUSE', str(timeout)) + def client_unpause(self): + """ + Unpause all redis clients + """ + return self.execute_command('CLIENT UNPAUSE') + def readwrite(self): "Disables read queries for a connection to a Redis Cluster slave node" return self.execute_command('READWRITE') diff --git a/tests/test_commands.py b/tests/test_commands.py index c9fdeef..362e7ab 100644 --- a/tests/test_commands.py +++ b/tests/test_commands.py @@ -402,6 +402,10 @@ class TestRedisCommands: with pytest.raises(exceptions.RedisError): r.client_pause(timeout='not an integer') + @skip_if_server_version_lt('6.2.0') + def test_client_unpause(self, r): + assert r.client_unpause() == b'OK' + def test_config_get(self, r): data = r.config_get() assert 'maxmemory' in data |