File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -219,7 +219,7 @@ class Redis(threading.local):
219
219
string_keys_to_dict ('ZSCORE ZINCRBY' , float_or_none ),
220
220
string_keys_to_dict (
221
221
'FLUSHALL FLUSHDB LSET LTRIM MSET RENAME '
222
- 'SAVE SELECT SET SHUTDOWN WATCH' ,
222
+ 'SAVE SELECT SET SHUTDOWN WATCH UNWATCH ' ,
223
223
lambda r : r == 'OK'
224
224
),
225
225
string_keys_to_dict ('BLPOP BRPOP' , lambda r : r and tuple (r ) or None ),
@@ -692,6 +692,15 @@ def watch(self, name):
692
692
693
693
return self .execute_command ('WATCH' , name )
694
694
695
+ def unwatch (self , name ):
696
+ """
697
+ Unwatches the value at key ``name``, or None of the key doesn't exist
698
+ """
699
+ if self .subscribed :
700
+ raise RedisError ("Can't call 'unwatch' from a pipeline'" )
701
+
702
+ return self .execute_command ('UNWATCH' , name )
703
+
695
704
#### LIST COMMANDS ####
696
705
def blpop (self , keys , timeout = 0 ):
697
706
"""
You can’t perform that action at this time.
0 commit comments