Browse Source

endure creating .vif files

pull/1189/head
Chris Lu 5 years ago
parent
commit
9134092a8d
  1. 4
      weed/storage/volume_loading.go
  2. 6
      weed/storage/volume_tier.go

4
weed/storage/volume_loading.go

@ -26,7 +26,9 @@ func (v *Volume) load(alsoLoadIndex bool, createDatIfMissing bool, needleMapKind
fileName := v.FileName()
alreadyHasSuperBlock := false
v.maybeLoadVolumeInfo()
if !v.maybeLoadVolumeInfo() {
v.SaveVolumeInfo()
}
if v.HasRemoteFile() {
v.noWriteCanDelete = true

6
weed/storage/volume_tier.go

@ -12,9 +12,7 @@ func (v *Volume) GetVolumeInfo() *volume_server_pb.VolumeInfo {
return v.volumeInfo
}
func (v *Volume) maybeLoadVolumeInfo() {
var found bool
func (v *Volume) maybeLoadVolumeInfo() (found bool){
v.volumeInfo, found = pb.MaybeLoadVolumeInfo(v.FileName() + ".vif")
@ -24,6 +22,8 @@ func (v *Volume) maybeLoadVolumeInfo() {
v.hasRemoteFile = true
}
return
}
func (v *Volume) HasRemoteFile() bool {

Loading…
Cancel
Save