Implement review suggestions
This commit is contained in:
@@ -21,6 +21,9 @@ type Storage interface {
|
||||
// It does nothing if no runner with the id is present in the store.
|
||||
Delete(id string)
|
||||
|
||||
// Purge removes all runners from the storage.
|
||||
Purge()
|
||||
|
||||
// Length returns the number of currently stored runners in the storage.
|
||||
Length() int
|
||||
|
||||
@@ -72,6 +75,12 @@ func (s *localRunnerStorage) Delete(id string) {
|
||||
delete(s.runners, id)
|
||||
}
|
||||
|
||||
func (s *localRunnerStorage) Purge() {
|
||||
s.Lock()
|
||||
defer s.Unlock()
|
||||
s.runners = make(map[string]Runner)
|
||||
}
|
||||
|
||||
func (s *localRunnerStorage) Sample() (Runner, bool) {
|
||||
s.Lock()
|
||||
defer s.Unlock()
|
||||
|
Reference in New Issue
Block a user