Fix disksize to work with new WAL
parent
dfd6b11dda
commit
ecbc79e7e3
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue