summaryrefslogtreecommitdiff
path: root/pkg/worker_watcher/worker_watcher.go
diff options
context:
space:
mode:
authorValery Piashchynski <[email protected]>2021-01-15 14:22:02 +0300
committerValery Piashchynski <[email protected]>2021-01-15 14:22:02 +0300
commite68c8e2eb9ea705e9d846023d545410c7613de64 (patch)
tree4fe8eadc1e7af49f1f282782ac1b7f2283fb63ea /pkg/worker_watcher/worker_watcher.go
parentf7d5f8fb3d14519dc89e346d6b2fc67c1837da5f (diff)
Use uniform snake case in the configs, fix critical issue with wrong
calculation of workers in stack at the Destroy stage
Diffstat (limited to 'pkg/worker_watcher/worker_watcher.go')
-rwxr-xr-xpkg/worker_watcher/worker_watcher.go18
1 files changed, 7 insertions, 11 deletions
diff --git a/pkg/worker_watcher/worker_watcher.go b/pkg/worker_watcher/worker_watcher.go
index 0c086d5f..bf1f2435 100755
--- a/pkg/worker_watcher/worker_watcher.go
+++ b/pkg/worker_watcher/worker_watcher.go
@@ -13,23 +13,19 @@ import (
// workerCreateFunc can be nil, but in that case, dead stack will not be replaced
func NewWorkerWatcher(allocator worker.Allocator, numWorkers int64, events events.Handler) worker.Watcher {
ww := &workerWatcher{
- stack: NewWorkersStack(),
- allocator: allocator,
- initialNumWorkers: numWorkers,
- actualNumWorkers: numWorkers,
- events: events,
+ stack: NewWorkersStack(uint64(numWorkers)),
+ allocator: allocator,
+ events: events,
}
return ww
}
type workerWatcher struct {
- mutex sync.RWMutex
- stack *Stack
- allocator worker.Allocator
- initialNumWorkers int64
- actualNumWorkers int64
- events events.Handler
+ mutex sync.RWMutex
+ stack *Stack
+ allocator worker.Allocator
+ events events.Handler
}
func (ww *workerWatcher) AddToWatch(workers []worker.BaseProcess) error {