add error checking

This commit is contained in:
Chris Lu
2019-03-19 05:34:43 -07:00
parent eb4a54d9fe
commit 916b809c08
2 changed files with 33 additions and 11 deletions

View File

@@ -335,7 +335,10 @@ func (v *Volume) copyDataBasedOnIndexFile(dstName, idxName string) (err error) {
}
n := new(Needle)
n.ReadData(v.dataFile, int64(offset)*NeedlePaddingSize, size, v.Version())
err :=n.ReadData(v.dataFile, int64(offset)*NeedlePaddingSize, size, v.Version())
if err != nil {
return nil
}
if n.HasTtl() && now >= n.LastModified+uint64(v.Ttl.Minutes()*60) {
return nil