Browse Source

fix get file stats for IsEmpty (#4576)

pull/4579/head
Konstantin Lebedev 2 years ago
committed by GitHub
parent
commit
1e22d5caf2
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      weed/storage/volume.go

4
weed/storage/volume.go

@ -333,6 +333,6 @@ func (v *Volume) IsReadOnly() bool {
return v.noWriteOrDelete || v.noWriteCanDelete || v.location.isDiskSpaceLow return v.noWriteOrDelete || v.noWriteCanDelete || v.location.isDiskSpaceLow
} }
func (v *Volume) IsEmpty() bool { func (v *Volume) IsEmpty() bool {
size, _, _ := v.DataBackend.GetStat()
return size <= 8 && v.ContentSize() == 0
datSize, _, _ := v.FileStat()
return datSize <= super_block.SuperBlockSize && v.ContentSize() == 0
} }
Loading…
Cancel
Save