diff --git a/cmd/ledis-server/main.go b/cmd/ledis-server/main.go index e2f246a..594a046 100644 --- a/cmd/ledis-server/main.go +++ b/cmd/ledis-server/main.go @@ -11,6 +11,7 @@ import ( "os" "os/signal" "runtime" + "strings" "syscall" ) @@ -64,7 +65,16 @@ func main() { cfg.UseReplication = true } else { cfg.Readonly = *readonly - cfg.UseReplication = *rpl + + // if rpl in command flag, use it. + for _, arg := range os.Args { + arg := strings.ToLower(arg) + if arg == "-rpl" || arg == "-rpl=true" || arg == "-rpl=false" { + cfg.UseReplication = *rpl + break + } + } + cfg.Replication.Sync = *rplSync }