Make search more lenient

When we fail to read a single message we don't need to fail the whole
search, just log the error and we can still get results back.
This commit is contained in:
Jeffas 2020-02-26 20:02:58 +00:00 committed by Reto Brunner
parent 00ed2ef06a
commit d6696f34b8

View file

@ -80,7 +80,8 @@ func (w *Worker) search(criteria *searchCriteria) ([]uint32, error) {
for _, key := range keys { for _, key := range keys {
success, err := w.searchKey(key, criteria, requiredParts) success, err := w.searchKey(key, criteria, requiredParts)
if err != nil { if err != nil {
return nil, err // don't return early so that we can still get some results
w.worker.Logger.Printf("Failed to search key %v: %v", key, err)
} else if success { } else if success {
matchedUids = append(matchedUids, key) matchedUids = append(matchedUids, key)
} }