about summary refs log tree commit diff stats
path: root/worker
diff options
context:
space:
mode:
authorJeffas <dev@jeffas.io>2020-02-26 20:02:58 +0000
committerReto Brunner <reto@labrat.space>2020-02-26 21:46:35 +0100
commitd6696f34b83044d4b9e7e714e75b8ff02d54cbc0 (patch)
tree989ea2af3b3af3a79fb914439359a49dace93b36 /worker
parent00ed2ef06a9bfb35d05c33948cbd93c03153636a (diff)
downloadaerc-d6696f34b83044d4b9e7e714e75b8ff02d54cbc0.tar.gz
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.
Diffstat (limited to 'worker')
-rw-r--r--worker/maildir/search.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/worker/maildir/search.go b/worker/maildir/search.go
index 47eab6a..f658c02 100644
--- a/worker/maildir/search.go
+++ b/worker/maildir/search.go
@@ -80,7 +80,8 @@ func (w *Worker) search(criteria *searchCriteria) ([]uint32, error) {
 	for _, key := range keys {
 		success, err := w.searchKey(key, criteria, requiredParts)
 		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 {
 			matchedUids = append(matchedUids, key)
 		}
class='alt'>
9cbd4199 ^
d3a9db3a ^
9cbd4199 ^
7fa80570 ^








9cbd4199 ^



1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73