Merge pull request #2697 from guo-sj/fix_bugs_in_return_value

This commit is contained in:
Chris Lu 2022-02-23 00:30:52 -08:00 committed by GitHub
commit bd092d8318
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -370,7 +370,7 @@ func (v *Volume) copyDataAndGenerateIndexFile(dstName, idxName string, prealloca
dst backend.BackendStorageFile
)
if dst, err = backend.CreateVolumeFile(dstName, preallocate, 0); err != nil {
return
return err
}
defer dst.Close()
@ -386,11 +386,11 @@ func (v *Volume) copyDataAndGenerateIndexFile(dstName, idxName string, prealloca
}
err = ScanVolumeFile(v.dir, v.Collection, v.Id, v.needleMapKind, scanner)
if err != nil {
return nil
return err
}
err = nm.SaveToIdx(idxName)
return
return nil
}
func copyDataBasedOnIndexFile(srcDatName, srcIdxName, dstDatName, datIdxName string, sb super_block.SuperBlock, version needle.Version, preallocate, compactionBytePerSecond int64, progressFn ProgressFunc) (err error) {