Move read-lock after function call that also uses that lock

This commit is contained in:
Ingo Oppermann 2023-07-25 17:14:11 +02:00
parent dc9727bfef
commit 81581091e8
No known key found for this signature in database
GPG Key ID: 2AB32426E9DD229E

View File

@ -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 {