Browse Source

Merge pull request #1051 from xushuxun/master

volume: read dat files' last modified time correctly
pull/1054/head
Chris Lu 5 years ago
committed by GitHub
parent
commit
fa160e00f3
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      weed/storage/volume_loading.go

2
weed/storage/volume_loading.go

@ -31,12 +31,12 @@ func (v *Volume) load(alsoLoadIndex bool, createDatIfMissing bool, needleMapKind
}
if canWrite {
v.dataFile, e = os.OpenFile(fileName+".dat", os.O_RDWR|os.O_CREATE, 0644)
v.lastModifiedTsSeconds = uint64(modifiedTime.Unix())
} else {
glog.V(0).Infoln("opening " + fileName + ".dat in READONLY mode")
v.dataFile, e = os.Open(fileName + ".dat")
v.readOnly = true
}
v.lastModifiedTsSeconds = uint64(modifiedTime.Unix())
if fileSize >= _SuperBlockSize {
alreadyHasSuperBlock = true
}

Loading…
Cancel
Save