diff options
author | Valery Piashchynski <[email protected]> | 2021-06-26 01:56:23 +0300 |
---|---|---|
committer | Valery Piashchynski <[email protected]> | 2021-06-26 01:56:23 +0300 |
commit | f87153d8b89c1b92040fad53b529c740a8f972fc (patch) | |
tree | a84bc14b225cdb9e00b3c1ab9553f247cecf731a /pkg/worker_watcher | |
parent | 7c0b63a9d0cee75e8bdedd2dcd0c20139f3ffd3f (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.go | 12 |
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) } } |