Skip to content
This repository has been archived by the owner on Feb 21, 2023. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
support for client unpause (redis/redis-py#1512)

Signed-off-by: Andrew-Chen-Wang <acwangpython@gmail.com>
  • Loading branch information
Andrew-Chen-Wang committed Oct 4, 2021
1 parent 0c3d2ba commit 1829beb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
6 changes: 6 additions & 0 deletions aioredis/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -1449,6 +1449,12 @@ def client_pause(self, timeout: int) -> Awaitable:
raise DataError("CLIENT PAUSE timeout must be an integer")
return self.execute_command("CLIENT PAUSE", str(timeout))

def client_unpause(self) -> Awaitable:
"""
Unpause all redis clients
"""
return self.execute_command("CLIENT UNPAUSE")

def readwrite(self) -> Awaitable:
"""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 @@ -481,6 +481,10 @@ async def test_client_pause(self, r: aioredis.Redis):
with pytest.raises(exceptions.RedisError):
await r.client_pause(timeout="not an integer")

@skip_if_server_version_lt("6.2.0")
async def test_client_unpause(self, r: aioredis.Redis):
assert await r.client_unpause() == b"OK"

async def test_config_get(self, r: aioredis.Redis):
data = await r.config_get()
assert "maxmemory" in data
Expand Down

0 comments on commit 1829beb

Please sign in to comment.