summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy McCurdy <andy@andymccurdy.com>2010-04-01 10:04:39 -0700
committerAndy McCurdy <andy@andymccurdy.com>2010-04-01 10:04:39 -0700
commit52e38277b60cc41d3aea2d018ca0aba0693930a5 (patch)
treec2095690bf7a5cecfe46e9ec7c8a4c9230423ab2
parent74d4666a4190541ee11da3ec629a60b9b1ce6d9d (diff)
downloadredis-py-52e38277b60cc41d3aea2d018ca0aba0693930a5.tar.gz
added support for BGREWRITEAOF
-rw-r--r--redis/client.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/redis/client.py b/redis/client.py
index 1c0e8fa..27939e3 100644
--- a/redis/client.py
+++ b/redis/client.py
@@ -212,6 +212,8 @@ class Redis(threading.local):
),
string_keys_to_dict('ZRANGE ZRANGEBYSCORE ZREVRANGE', zset_score_pairs),
{
+ 'BGREWRITEAOF': lambda r: \
+ r == 'Background rewriting of AOF file started',
'BGSAVE': lambda r: r == 'Background saving started',
'HGETALL': lambda r: r and pairs_to_dict(r) or None,
'INFO': parse_info,
@@ -411,7 +413,12 @@ class Redis(threading.local):
self.connection = self.get_connection(
host, port, db, password, socket_timeout)
+
#### SERVER INFORMATION ####
+ def bgrewriteaof(self):
+ "Tell the Redis server to rewrite the AOF file from data in memory."
+ return self.execute_command('BGREWRITEAOF')
+
def bgsave(self):
"""
Tell the Redis server to save its data to disk. Unlike save(),