diff --git a/cmd/redis-shake/main.go b/cmd/redis-shake/main.go index 4d42575a..e84129a0 100644 --- a/cmd/redis-shake/main.go +++ b/cmd/redis-shake/main.go @@ -96,13 +96,10 @@ func main() { log.Infof("create RedisStandaloneWriter: %v", opts.Address) } if config.Opt.Advanced.EmptyDBBeforeSync { - if opts.OffReply { - entry := entry.NewEntry() - entry.Argv = []string{"FLUSHALL"} - theWriter.Write(entry) - } else { - theWriter.Flush() - } + // exec FLUSHALL command to flush db + entry := entry.NewEntry() + entry.Argv = []string{"FLUSHALL"} + theWriter.Write(entry) } } else { log.Panicf("no writer config entry found") diff --git a/internal/writer/interface.go b/internal/writer/interface.go index acdb0335..523f14fb 100644 --- a/internal/writer/interface.go +++ b/internal/writer/interface.go @@ -8,6 +8,5 @@ import ( type Writer interface { status.Statusable Write(entry *entry.Entry) - Flush() Close() } diff --git a/internal/writer/redis_cluster_writer.go b/internal/writer/redis_cluster_writer.go index 584434bd..76853907 100644 --- a/internal/writer/redis_cluster_writer.go +++ b/internal/writer/redis_cluster_writer.go @@ -23,12 +23,6 @@ func NewRedisClusterWriter(opts *RedisWriterOptions) Writer { return rw } -func (r *RedisClusterWriter) Flush() { - for _, writer := range r.writers { - writer.Flush() - } -} - func (r *RedisClusterWriter) Close() { for _, writer := range r.writers { writer.Close() diff --git a/internal/writer/redis_standalone_writer.go b/internal/writer/redis_standalone_writer.go index 2c917ec8..4e636a4a 100644 --- a/internal/writer/redis_standalone_writer.go +++ b/internal/writer/redis_standalone_writer.go @@ -57,13 +57,6 @@ func NewRedisStandaloneWriter(opts *RedisWriterOptions) Writer { return rw } -func (w *redisStandaloneWriter) Flush() { - reply := w.client.DoWithStringReply("FLUSHALL") - if reply != "OK" { - log.Panicf("flush failed with reply: %s", reply) - } -} - func (w *redisStandaloneWriter) Close() { if !w.offReply { close(w.chWaitReply)