Fix disksize to work with new WAL

pull/4011/head
Paul Dix 2015-09-08 19:37:33 -07:00
parent dfd6b11dda
commit ecbc79e7e3
1 changed files with 5 additions and 8 deletions

View File

@ -211,15 +211,12 @@ func (l *Log) Open() error {
func (l *Log) DiskSize() (int64, error) { func (l *Log) DiskSize() (int64, error) {
l.mu.RLock() l.mu.RLock()
defer l.mu.RUnlock() defer l.mu.RUnlock()
var size int64
for _, partition := range l.partitions { stat, err := os.Stat(l.path)
stat, err := os.Stat(partition.path)
if err != nil { if err != nil {
return 0, err return 0, err
} }
size += stat.Size() return stat.Size(), nil
}
return size, nil
} }
// Cursor will return a cursor object to Seek and iterate with Next for the WAL cache for the given // Cursor will return a cursor object to Seek and iterate with Next for the WAL cache for the given