summaryrefslogtreecommitdiff
path: root/pkg/worker_watcher/worker_watcher.go
diff options
context:
space:
mode:
authorValery Piashchynski <[email protected]>2021-01-15 19:32:18 +0300
committerGitHub <[email protected]>2021-01-15 19:32:18 +0300
commit4c970f1876dfb5918ec2dc1d358a52698c6de040 (patch)
tree37222d13701c84b00ccc1e5d57844d2756369b5a /pkg/worker_watcher/worker_watcher.go
parentf648d96c8516652f3231eb87be1f0a000e12793f (diff)
parent609fe5057f9f3cc2f7f5104f305f08a0496e8fef (diff)
Merge pull request #477 from spiral/feature/worker_watcher_testsv2.0.0-beta8
feat(worker_watcher): Add stack tests
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 {