diff options
author | Wolfy-J <[email protected]> | 2018-01-28 18:59:40 +0300 |
---|---|---|
committer | Wolfy-J <[email protected]> | 2018-01-28 18:59:40 +0300 |
commit | da67acbb1bdfa1e466483bf7ab1fdc4118fdc8fd (patch) | |
tree | 904d0ab36d04d13089ceb257a7b5604dbf5f031a | |
parent | 730c76737a64c798b37adefb15ea0f223361631b (diff) |
Context
-rw-r--r-- | pool.go | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -178,6 +178,11 @@ func (p *Pool) replaceWorker(w *Worker, caused interface{}) { if nw, err := p.createWorker(); err != nil { p.throw(EventError, w, err) + + if len(p.Workers()) == 0 { + // possible situation when major error causes all PHP scripts to die (for example dead DB) + p.throw(EventError, nil, fmt.Errorf("all workers dead")) + } } else { p.free <- nw } |