mirror of https://github.com/ledisdb/ledisdb.git
bug fix: stop replication before close
This commit is contained in:
parent
6d293ce152
commit
595ead55bd
|
@ -50,6 +50,9 @@ func (l *Ledis) handleReplication() {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (l *Ledis) onReplication() {
|
func (l *Ledis) onReplication() {
|
||||||
|
l.wg.Add(1)
|
||||||
|
defer l.wg.Done()
|
||||||
|
|
||||||
AsyncNotify(l.rc)
|
AsyncNotify(l.rc)
|
||||||
|
|
||||||
for {
|
for {
|
||||||
|
@ -58,6 +61,8 @@ func (l *Ledis) onReplication() {
|
||||||
l.handleReplication()
|
l.handleReplication()
|
||||||
case <-time.After(5 * time.Second):
|
case <-time.After(5 * time.Second):
|
||||||
l.handleReplication()
|
l.handleReplication()
|
||||||
|
case <-l.quit:
|
||||||
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue