diff options
author | Chayim <chayim@users.noreply.github.com> | 2021-09-01 11:44:59 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-01 11:44:59 +0300 |
commit | 9f64c56e0f6994df0609a803e613a055ee57a7cd (patch) | |
tree | 4df1c0274f58da34dc0f5f9dbc5af3a7146ddd62 /redis/commands.py | |
parent | 18c1cc7482d2177809d381e91721f119117849ff (diff) | |
download | redis-py-9f64c56e0f6994df0609a803e613a055ee57a7cd.tar.gz |
bgsave schedule support (#1555)
bgsave tests
Part of #1546
Diffstat (limited to 'redis/commands.py')
-rw-r--r-- | redis/commands.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/redis/commands.py b/redis/commands.py index 7066bd8..e1f7368 100644 --- a/redis/commands.py +++ b/redis/commands.py @@ -268,12 +268,15 @@ class Commands: "Tell the Redis server to rewrite the AOF file from data in memory." return self.execute_command('BGREWRITEAOF') - def bgsave(self): + def bgsave(self, schedule=True): """ Tell the Redis server to save its data to disk. Unlike save(), this method is asynchronous and returns immediately. """ - return self.execute_command('BGSAVE') + pieces = [] + if schedule: + pieces.append("SCHEDULE") + return self.execute_command('BGSAVE', *pieces) def client_kill(self, address): "Disconnects the client at ``address`` (ip:port)" |