mirror of https://github.com/ledisdb/ledisdb.git
add the missing code file for the db flush
This commit is contained in:
parent
247f105ad7
commit
84a70ad0c0
|
@ -0,0 +1,19 @@
|
|||
package ledis
|
||||
|
||||
func (db *DB) Flush() (drop int64, err error) {
|
||||
all := [...](func() (int64, error)){
|
||||
db.KvFlush,
|
||||
db.LFlush,
|
||||
db.HFlush,
|
||||
db.ZFlush}
|
||||
|
||||
for _, flush := range all {
|
||||
if n, e := flush(); e != nil {
|
||||
err = e
|
||||
return
|
||||
} else {
|
||||
drop += n
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
Loading…
Reference in New Issue