forked from mirror/ledisdb
fix can not close slave if master is down
This commit is contained in:
parent
3cd534aefb
commit
fde91d588a
|
@ -155,6 +155,10 @@ func (m *master) runReplication(restart bool) {
|
||||||
for {
|
for {
|
||||||
m.state.Set(replConnectState)
|
m.state.Set(replConnectState)
|
||||||
|
|
||||||
|
if m.needQuit() {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
if _, err := m.conn.Do("ping"); err != nil {
|
if _, err := m.conn.Do("ping"); err != nil {
|
||||||
log.Errorf("ping master %s error %s, try 3s later", m.addr, err.Error())
|
log.Errorf("ping master %s error %s, try 3s later", m.addr, err.Error())
|
||||||
time.Sleep(3 * time.Second)
|
time.Sleep(3 * time.Second)
|
||||||
|
|
Loading…
Reference in New Issue