diff options
author | Valery Piashchynski <[email protected]> | 2021-12-14 10:48:11 +0300 |
---|---|---|
committer | Valery Piashchynski <[email protected]> | 2021-12-14 10:48:11 +0300 |
commit | 25acfc64865c6069df7e1911b508fa0ba9c3324a (patch) | |
tree | ceedb5c6da7975052172209032d21e79eb38c89c /pool | |
parent | e273e2b3fe086450dd58d353ddde0ccce6b146cc (diff) |
proper ww destroy
supervised pool ticket stop
Signed-off-by: Valery Piashchynski <[email protected]>
Diffstat (limited to 'pool')
-rwxr-xr-x | pool/supervisor_pool.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/pool/supervisor_pool.go b/pool/supervisor_pool.go index 1a94f6a0..a7a1ae52 100755 --- a/pool/supervisor_pool.go +++ b/pool/supervisor_pool.go @@ -84,15 +84,17 @@ func (sp *supervised) RemoveWorker(worker worker.BaseProcess) error { func (sp *supervised) Destroy(ctx context.Context) { sp.pool.Destroy(ctx) + sp.Stop() } func (sp *supervised) Start() { go func() { watchTout := time.NewTicker(sp.cfg.WatchTick) + defer watchTout.Stop() + for { select { case <-sp.stopCh: - watchTout.Stop() return // stop here case <-watchTout.C: |