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:
parent
00ed2ef06a
commit
d6696f34b8
1 changed files with 2 additions and 1 deletions
|
@ -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)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue