diff options
author | Valery Piashchynski <[email protected]> | 2019-11-17 15:32:26 +0300 |
---|---|---|
committer | Valery Piashchynski <[email protected]> | 2019-11-17 15:32:26 +0300 |
commit | 492faef8e51fce243216758baa8c16b4173603df (patch) | |
tree | da6376fba9a9af3358017dcbd5034677192f407b /static_pool.go | |
parent | b81f2b121eb3a49372662d0bc9c19c53366f33fc (diff) |
complete half
Diffstat (limited to 'static_pool.go')
-rw-r--r-- | static_pool.go | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/static_pool.go b/static_pool.go index 66b1366e..735bc701 100644 --- a/static_pool.go +++ b/static_pool.go @@ -42,7 +42,6 @@ type StaticPool struct { workers []*Worker // invalid declares set of workers to be removed from the pool. - mur sync.Mutex remove sync.Map // pool is being destroyed @@ -294,7 +293,12 @@ func (p *StaticPool) discardWorker(w *Worker, caused interface{}) { // destroyWorker destroys workers and removes it from the pool. func (p *StaticPool) destroyWorker(w *Worker, caused interface{}) { - go w.Stop() + go func() { + err := w.Stop() + if err != nil { + p.throw(EventWorkerError, WorkerError{Worker: w, Caused: err}) + } + }() select { case <-w.waitDone: |