From 7f9b05dc4ba046fb7d30843c76214e7be62d5347 Mon Sep 17 00:00:00 2001
From: ale <ale@incal.net>
Date: Sat, 2 Oct 2021 15:18:00 +0100
Subject: [PATCH] Make ResultStore.Find() look in errors too

---
 probes/results.go | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/probes/results.go b/probes/results.go
index 32be2f3..88ddbc8 100644
--- a/probes/results.go
+++ b/probes/results.go
@@ -106,11 +106,19 @@ func (r *memResultStore) EachErrs(f func(*Result)) {
 
 func (r *memResultStore) Find(id string) (out *Result) {
 	r.mx.Lock()
+	defer r.mx.Unlock()
 	r.last.Each(func(r *Result) {
 		if r.ID == id {
 			out = r
 		}
 	})
-	r.mx.Unlock()
+	if out != nil {
+		return
+	}
+	r.errs.Each(func(r *Result) {
+		if r.ID == id {
+			out = r
+		}
+	})
 	return
 }
-- 
GitLab