Skip to content

Commit 9fc7716

Browse files
committed
Support SCRIPT FLUSH (SYNC|ASYNC)
Needed to support redis-py 4.0.0b1.
1 parent a0fd16a commit 9fc7716

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fakeredis/_server.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2562,7 +2562,7 @@ def script(self, subcmd, *args):
25622562
elif casematch(subcmd, b'exists'):
25632563
return [int(sha1 in self._server.script_cache) for sha1 in args]
25642564
elif casematch(subcmd, b'flush'):
2565-
if len(args) != 0:
2565+
if len(args) > 1 or (len(args) == 1 and casenorm(args[0]) not in {b'sync', b'async'}):
25662566
raise SimpleError(BAD_SUBCOMMAND_MSG.format('SCRIPT'))
25672567
self._server.script_cache = {}
25682568
return OK

0 commit comments

Comments
 (0)