forked from mirror/ledisdb
Close snapshot and iterator when creating ledis dump (#245)
This commit is contained in:
parent
ca344836ab
commit
3a2cbda7f2
|
@ -60,6 +60,7 @@ func (l *Ledis) Dump(w io.Writer) error {
|
||||||
l.wLock.Unlock()
|
l.wLock.Unlock()
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
defer snap.Close()
|
||||||
|
|
||||||
l.wLock.Unlock()
|
l.wLock.Unlock()
|
||||||
|
|
||||||
|
@ -72,6 +73,7 @@ func (l *Ledis) Dump(w io.Writer) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
it := snap.NewIterator()
|
it := snap.NewIterator()
|
||||||
|
defer it.Close()
|
||||||
it.SeekToFirst()
|
it.SeekToFirst()
|
||||||
|
|
||||||
compressBuf := make([]byte, 4096)
|
compressBuf := make([]byte, 4096)
|
||||||
|
|
Loading…
Reference in New Issue