diff options
author | gmbnomis <gmbnomis@users.noreply.github.com> | 2023-01-29 14:46:42 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-29 15:46:42 +0200 |
commit | 9e6a9b52e5aab021d239ca56e27f06bca871cbf0 (patch) | |
tree | 6f950974fce09e3f4aa6d823af335ac2d43c542e /redis | |
parent | 42604b68c906a156fd64a001a83e0e84a0fa63fa (diff) | |
download | redis-py-9e6a9b52e5aab021d239ca56e27f06bca871cbf0.tar.gz |
Fix unlink in cluster pipeline (#2562)
Implement unlink() like delete() to make it work when
used in a cluster pipeline.
Diffstat (limited to 'redis')
-rw-r--r-- | redis/cluster.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/redis/cluster.py b/redis/cluster.py index 5f730a8..d6dc02d 100644 --- a/redis/cluster.py +++ b/redis/cluster.py @@ -2136,6 +2136,17 @@ class ClusterPipeline(RedisCluster): return self.execute_command("DEL", names[0]) + def unlink(self, *names): + """ + "Unlink a key specified by ``names``" + """ + if len(names) != 1: + raise RedisClusterException( + "unlinking multiple keys is not implemented in pipeline command" + ) + + return self.execute_command("UNLINK", names[0]) + def block_pipeline_command(name: str) -> Callable[..., Any]: """ |