diff options
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: |