leveldb recover error handling

This commit is contained in:
Chris Lu
2020-05-26 00:03:44 -07:00
parent 5d3ec22975
commit ef2b3a0801
2 changed files with 7 additions and 3 deletions

View File

@@ -38,7 +38,9 @@ func NewLevelDbNeedleMap(dbFileName string, indexFile *os.File, opts *opt.Option
if errors.IsCorrupted(err) {
m.db, err = leveldb.RecoverFile(dbFileName, opts)
}
return
if err != nil {
return
}
}
glog.V(1).Infof("Loading %s...", indexFile.Name())
mm, indexLoadError := newNeedleMapMetricFromIndexFile(indexFile)