forked from mirror/ledisdb
fix use_replication has no effect error
This commit is contained in:
parent
1760e9fe20
commit
13767e1bb2
|
@ -11,6 +11,7 @@ import (
|
||||||
"os"
|
"os"
|
||||||
"os/signal"
|
"os/signal"
|
||||||
"runtime"
|
"runtime"
|
||||||
|
"strings"
|
||||||
"syscall"
|
"syscall"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -64,7 +65,16 @@ func main() {
|
||||||
cfg.UseReplication = true
|
cfg.UseReplication = true
|
||||||
} else {
|
} else {
|
||||||
cfg.Readonly = *readonly
|
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
|
cfg.Replication.Sync = *rplSync
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue