From 9f5d7f4a0fd72bcc1206660cb4aeee6b66c88e0a Mon Sep 17 00:00:00 2001 From: siddontang Date: Sun, 3 May 2015 11:24:03 +0800 Subject: [PATCH] add CompactStore interface --- ledis/ledis.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ledis/ledis.go b/ledis/ledis.go index 7397f2a..5a4fc8d 100644 --- a/ledis/ledis.go +++ b/ledis/ledis.go @@ -230,3 +230,10 @@ func (l *Ledis) checkTTL() { func (l *Ledis) StoreStat() *store.Stat { return l.ldb.Stat() } + +func (l *Ledis) CompactStore() error { + l.wLock.Lock() + defer l.wLock.Unlock() + + return l.ldb.Compact() +}