From 429c033b68dcd9beff53a80e3ca6749634013231 Mon Sep 17 00:00:00 2001 From: silentsai Date: Thu, 22 May 2014 12:49:04 +0800 Subject: [PATCH] remove 'FlushDB' temporarily --- ledis/ledis.go | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/ledis/ledis.go b/ledis/ledis.go index 33bd09e..330f24c 100644 --- a/ledis/ledis.go +++ b/ledis/ledis.go @@ -80,24 +80,3 @@ func (l *Ledis) Select(index int) (*DB, error) { return l.dbs[index], nil } - -func (l *Ledis) FlushDB() (drop int64, err error) { - db := l.ldb - if db == nil { - drop = int64(-1) - return - } - - ftx := &tx{wb: db.NewWriteBatch()} - ftx.Lock() - defer ftx.Unlock() - - it := db.Iterator(nil, nil, leveldb.RangeClose, 0, -1) - for ; it.Valid(); it.Next() { - ftx.Delete(it.Key()) - drop++ - } - - err = ftx.Commit() - return -}