Skip to content

Commit

Permalink
support for client unpause (#1512)
Browse files Browse the repository at this point in the history
  • Loading branch information
chayim authored Jul 25, 2021
1 parent 57cf7ff commit 88e5bd8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
6 changes: 6 additions & 0 deletions redis/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -1300,6 +1300,12 @@ def client_pause(self, timeout):
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')
Expand Down
4 changes: 4 additions & 0 deletions tests/test_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,10 @@ def test_client_pause(self, r):
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
Expand Down

0 comments on commit 88e5bd8

Please sign in to comment.