summaryrefslogtreecommitdiff
path: root/pkg/worker_watcher/container/channel/vec.go
diff options
context:
space:
mode:
authorValery Piashchynski <[email protected]>2021-08-26 18:32:51 +0300
committerValery Piashchynski <[email protected]>2021-08-26 18:32:51 +0300
commitefb3efa98c8555815330274f0618bfc080f4c65c (patch)
treeb3bcabdb22fade6ef06d865d60995bc15f84cf1c /pkg/worker_watcher/container/channel/vec.go
parent3212a5b59b6dcd8aa6edac137e945d42f6f9e0ce (diff)
Move drivers to the plugin's root.
Fix #771, add tests. Signed-off-by: Valery Piashchynski <[email protected]>
Diffstat (limited to 'pkg/worker_watcher/container/channel/vec.go')
-rw-r--r--pkg/worker_watcher/container/channel/vec.go5
1 files changed, 1 insertions, 4 deletions
diff --git a/pkg/worker_watcher/container/channel/vec.go b/pkg/worker_watcher/container/channel/vec.go
index 7fb65a92..5605f1e0 100644
--- a/pkg/worker_watcher/container/channel/vec.go
+++ b/pkg/worker_watcher/container/channel/vec.go
@@ -15,14 +15,11 @@ type Vec struct {
destroy uint64
// channel with the workers
workers chan worker.BaseProcess
-
- len uint64
}
func NewVector(len uint64) *Vec {
vec := &Vec{
destroy: 0,
- len: len,
workers: make(chan worker.BaseProcess, len),
}
@@ -48,7 +45,7 @@ func (v *Vec) Push(w worker.BaseProcess) {
1. TTL is set with no requests during the TTL
2. Violated Get <-> Release operation (how ??)
*/
- for i := uint64(0); i < v.len; i++ {
+ for i := 0; i < len(v.workers); i++ {
/*
We need to drain vector until we found a worker in the Invalid/Killing/Killed/etc states.
*/