diff --git a/ledis/ledis_db.go b/ledis/ledis_db.go new file mode 100644 index 0000000..af583c1 --- /dev/null +++ b/ledis/ledis_db.go @@ -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 +}