remove 'FlushDB' temporarily

This commit is contained in:
silentsai 2014-05-22 12:49:04 +08:00
parent 9f22f3e11e
commit 429c033b68
1 changed files with 0 additions and 21 deletions

View File

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