Skip to content

Commit

Permalink
Added direct support for the flushall command.
Browse files Browse the repository at this point in the history
  • Loading branch information
rlotun committed Feb 2, 2011
1 parent 83609b2 commit a786bd2
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion txredis/protocol.py
Expand Up @@ -895,7 +895,17 @@ def move(self, key, db):
def flush(self, all_dbs=False):
"""
"""
self._send('FLUSHALL' if all_dbs else 'FLUSHDB')
if all_dbs:
return self.flushall()
else:
return self.flushdb()

def flushall(self):
self._send('FLUSHALL')
return self.getResponse()

def flushdb(self):
self._send('FLUSHDB')
return self.getResponse()

# Persistence control commands
Expand Down

0 comments on commit a786bd2

Please sign in to comment.