diff options
author | Valery Piashchynski <[email protected]> | 2020-12-23 23:35:44 +0300 |
---|---|---|
committer | Valery Piashchynski <[email protected]> | 2020-12-23 23:35:44 +0300 |
commit | e78c13d93a729a9008f283aa3db6910f3e833165 (patch) | |
tree | e633604841b80c42b195388429dc12349e4b9d1f /pkg/worker_watcher | |
parent | c21fe8e2f99c3cb8e3c1482e35f2efa0e914c337 (diff) |
Initial implementation of serve, reset, workers commands for the RR2
Diffstat (limited to 'pkg/worker_watcher')
-rwxr-xr-x | pkg/worker_watcher/worker_watcher.go | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/pkg/worker_watcher/worker_watcher.go b/pkg/worker_watcher/worker_watcher.go index 55191ce6..39d334ba 100755 --- a/pkg/worker_watcher/worker_watcher.go +++ b/pkg/worker_watcher/worker_watcher.go @@ -128,6 +128,8 @@ func (stack *Stack) Destroy(ctx context.Context) { for i := 0; i < len(stack.workers); i++ { // set state for the stack in the stack (unused at the moment) stack.workers[i].State().Set(internal.StateDestroyed) + // kill the worker + _ = stack.workers[i].Kill() } stack.mutex.Unlock() tt.Stop() @@ -223,11 +225,6 @@ func (ww *workerWatcher) AllocateNew() error { ww.stack.mutex.Unlock() ww.PushWorker(sw) - ww.events.Push(events.PoolEvent{ - Event: events.EventWorkerConstruct, - Payload: sw, - }) - return nil } @@ -282,6 +279,7 @@ func (ww *workerWatcher) wait(w worker.BaseProcess) { if w.State().Value() == internal.StateDestroyed { // worker was manually destroyed, no need to replace + ww.events.Push(events.PoolEvent{Event: events.EventWorkerDestruct, Payload: w}) return } |