From 11e8e07a0cc69249cfe671d9b2b68cca03b49b12 Mon Sep 17 00:00:00 2001 From: lukemartinlogan Date: Tue, 11 Jun 2024 19:43:50 -0500 Subject: [PATCH] Add pipeline clean --- builtin/builtin/redis-benchmark/pkg.py | 12 ------------ builtin/builtin/redis/pkg.py | 13 +++++++++++++ 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/builtin/builtin/redis-benchmark/pkg.py b/builtin/builtin/redis-benchmark/pkg.py index a640c747..1c571266 100644 --- a/builtin/builtin/redis-benchmark/pkg.py +++ b/builtin/builtin/redis-benchmark/pkg.py @@ -129,18 +129,6 @@ def start(self): f'-h {hostfile.hosts[self.config["node"]]}', f'--cluster' ] - self.log('Flushing all data and resetting the cluster', color=Color.YELLOW) - for host in hostfile.hosts: - Exec(f'redis-cli -p {self.config["port"]} -h {host} flushall', - LocalExecInfo(env=self.mod_env, - hostfile=hostfile, - do_dbg=self.config['do_dbg'], - dbg_port=self.config['dbg_port'])) - Exec(f'redis-cli -p {self.config["port"]} -h {host} cluster reset', - LocalExecInfo(env=self.mod_env, - hostfile=hostfile, - do_dbg=self.config['do_dbg'], - dbg_port=self.config['dbg_port'])) self.log('Starting the cluster', color=Color.YELLOW) Exec(' '.join(cmd), LocalExecInfo(env=self.mod_env, diff --git a/builtin/builtin/redis/pkg.py b/builtin/builtin/redis/pkg.py index 9fd926e9..d28abc05 100644 --- a/builtin/builtin/redis/pkg.py +++ b/builtin/builtin/redis/pkg.py @@ -87,6 +87,19 @@ def start(self): # Create redis clients if len(hostfile) > 1: + self.log('Flushing all data and resetting the cluster', color=Color.YELLOW) + for host in hostfile.hosts: + Exec(f'redis-cli -p {self.config["port"]} -h {host} flushall', + LocalExecInfo(env=self.mod_env, + hostfile=hostfile, + do_dbg=self.config['do_dbg'], + dbg_port=self.config['dbg_port'])) + Exec(f'redis-cli -p {self.config["port"]} -h {host} cluster reset', + LocalExecInfo(env=self.mod_env, + hostfile=hostfile, + do_dbg=self.config['do_dbg'], + dbg_port=self.config['dbg_port'])) + self.log('Creating the cluster', color=Color.YELLOW) cmd = [ 'redis-cli',