Remove data race in the runner length function

This commit is contained in:
Maximilian Paß
2021-06-03 11:38:40 +02:00
parent 02b3f52a11
commit 5f35ba30a2
2 changed files with 3 additions and 1 deletions

View File

@@ -70,5 +70,7 @@ func (s *localRunnerStorage) Sample() (Runner, bool) {
}
func (s *localRunnerStorage) Length() int {
s.RLock()
defer s.RUnlock()
return len(s.runners)
}