From 81581091e84d67fc2a731585cb85d416fe84e15b Mon Sep 17 00:00:00 2001 From: Ingo Oppermann Date: Tue, 25 Jul 2023 17:14:11 +0200 Subject: [PATCH] Move read-lock after function call that also uses that lock --- restream/restream.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/restream/restream.go b/restream/restream.go index 9ca96a08..a7271854 100644 --- a/restream/restream.go +++ b/restream/restream.go @@ -1801,13 +1801,13 @@ func (r *restream) GetProcessLog(id app.ProcessID) (*app.Log, error) { } func (r *restream) SearchProcessLogHistory(idpattern, refpattern, state string, from, to *time.Time) []app.LogHistorySearchResult { - r.lock.RLock() - defer r.lock.RUnlock() - result := []app.LogHistorySearchResult{} ids := r.GetProcessIDs(idpattern, refpattern, "", "") + r.lock.RLock() + defer r.lock.RUnlock() + for _, id := range ids { task, ok := r.tasks[id] if !ok {