summaryrefslogtreecommitdiff
path: root/pkg/worker_watcher
diff options
context:
space:
mode:
authorValery Piashchynski <[email protected]>2021-06-26 01:56:23 +0300
committerValery Piashchynski <[email protected]>2021-06-26 01:56:23 +0300
commitf87153d8b89c1b92040fad53b529c740a8f972fc (patch)
treea84bc14b225cdb9e00b3c1ab9553f247cecf731a /pkg/worker_watcher
parent7c0b63a9d0cee75e8bdedd2dcd0c20139f3ffd3f (diff)
- Add more tests
Signed-off-by: Valery Piashchynski <[email protected]>
Diffstat (limited to 'pkg/worker_watcher')
-rw-r--r--pkg/worker_watcher/container/vec.go12
1 files changed, 5 insertions, 7 deletions
diff --git a/pkg/worker_watcher/container/vec.go b/pkg/worker_watcher/container/vec.go
index 8072af10..b9150c43 100644
--- a/pkg/worker_watcher/container/vec.go
+++ b/pkg/worker_watcher/container/vec.go
@@ -38,13 +38,11 @@ func (v *Vec) Dequeue(ctx context.Context) (worker.BaseProcess, error) {
return nil, errors.E(errors.WatcherStopped)
}
- for {
- select {
- case w := <-v.workers:
- return w, nil
- case <-ctx.Done():
- return nil, errors.E(ctx.Err(), errors.NoFreeWorkers)
- }
+ select {
+ case w := <-v.workers:
+ return w, nil
+ case <-ctx.Done():
+ return nil, errors.E(ctx.Err(), errors.NoFreeWorkers)
}
}