Skip to content

Commit

Permalink
Added locking of AgentCache for Count function
Browse files Browse the repository at this point in the history
  • Loading branch information
Michal Tichák committed Sep 6, 2024
1 parent 89b91fe commit 13e0342
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion core/task/agentcache.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,5 +75,7 @@ func (ac *AgentCache) Count() (count int) {
if ac == nil || ac.store == nil {
return 0
}
ac.mu.RLock()
defer ac.mu.RUnlock()
return len(ac.store)
}
}

0 comments on commit 13e0342

Please sign in to comment.