fix use_replication has no effect error

This commit is contained in:
siddontang 2015-02-14 14:38:13 +08:00
parent 1760e9fe20
commit 13767e1bb2
1 changed files with 11 additions and 1 deletions

View File

@ -11,6 +11,7 @@ import (
"os"
"os/signal"
"runtime"
"strings"
"syscall"
)
@ -64,7 +65,16 @@ func main() {
cfg.UseReplication = true
} else {
cfg.Readonly = *readonly
// 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
}