diff options
author | Wolfy-J <[email protected]> | 2018-06-11 23:05:31 +0300 |
---|---|---|
committer | Wolfy-J <[email protected]> | 2018-06-11 23:05:31 +0300 |
commit | e88b452bb6b0ae2a16fc98dcdad480e50403b7bc (patch) | |
tree | 6cc1aa5d640316300eed89d7fbbb4faad1166da1 /static_pool.go | |
parent | 8880784ef5eea830820c2bb8eb5a9525f560beb3 (diff) |
replace dead workers
Diffstat (limited to 'static_pool.go')
-rw-r--r-- | static_pool.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/static_pool.go b/static_pool.go index 665be234..b043b022 100644 --- a/static_pool.go +++ b/static_pool.go @@ -149,6 +149,7 @@ func (p *StaticPool) allocateWorker() (w *Worker, err error) { if w.state.Value() == StateReady { return w, nil } else { + go p.replaceWorker(w, w.state.Value()) continue } default: @@ -165,6 +166,7 @@ func (p *StaticPool) allocateWorker() (w *Worker, err error) { if w.state.Value() == StateReady { return w, nil } else { + go p.replaceWorker(w, w.state.Value()) continue } } @@ -270,4 +272,4 @@ func (p *StaticPool) throw(event int, ctx interface{}) { if p.listener != nil { p.listener(event, ctx) } -}
\ No newline at end of file +} |