Skip to content

Commit

Permalink
Add pipeline clean
Browse files Browse the repository at this point in the history
  • Loading branch information
lukemartinlogan committed Jun 12, 2024
1 parent 8798ec9 commit 11e8e07
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
12 changes: 0 additions & 12 deletions builtin/builtin/redis-benchmark/pkg.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
13 changes: 13 additions & 0 deletions builtin/builtin/redis/pkg.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit 11e8e07

Please sign in to comment.