1
0
Fork 0
mirror of https://github.com/chrislusf/seaweedfs synced 2024-07-02 07:06:44 +02:00

endure creating .vif files

This commit is contained in:
Chris Lu 2019-12-28 21:36:15 -08:00
parent 0cc8347a3a
commit 9134092a8d
2 changed files with 6 additions and 4 deletions

View file

@ -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

View file

@ -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 {