diff options
Diffstat (limited to 'redis/commands/core.py')
-rw-r--r-- | redis/commands/core.py | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/redis/commands/core.py b/redis/commands/core.py index 62e3ba8..835ea61 100644 --- a/redis/commands/core.py +++ b/redis/commands/core.py @@ -637,6 +637,31 @@ class ManagementCommands: args.append(b"ASYNC") return self.execute_command("FLUSHDB", *args, **kwargs) + def sync(self): + """ + Initiates a replication stream from the master. + + For more information check https://redis.io/commands/sync + """ + from redis.client import NEVER_DECODE + + options = {} + options[NEVER_DECODE] = [] + return self.execute_command("SYNC", **options) + + def psync(self, replicationid, offset): + """ + Initiates a replication stream from the master. + Newer version for `sync`. + + For more information check https://redis.io/commands/sync + """ + from redis.client import NEVER_DECODE + + options = {} + options[NEVER_DECODE] = [] + return self.execute_command("PSYNC", replicationid, offset, **options) + def swapdb(self, first, second, **kwargs): """ Swap two databases |