add the missing code file for the db flush

This commit is contained in:
silentsai 2014-05-22 20:02:22 +08:00
parent 247f105ad7
commit 84a70ad0c0
1 changed files with 19 additions and 0 deletions

19
ledis/ledis_db.go Normal file
View File

@ -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
}