summaryrefslogtreecommitdiff
path: root/pkg/worker_watcher/worker_watcher.go
diff options
context:
space:
mode:
authorValery Piashchynski <[email protected]>2020-12-17 10:19:01 +0300
committerValery Piashchynski <[email protected]>2020-12-17 10:19:01 +0300
commitacb53196f8ff4518c515225b39c6fb2bac64faae (patch)
tree3c016e03132a38ec3dd3fce737120a0fdc9642c9 /pkg/worker_watcher/worker_watcher.go
parent8422e300f64f20d86ffccf773d41109285bbc12d (diff)
Update events handler, add mutex to push
Diffstat (limited to 'pkg/worker_watcher/worker_watcher.go')
-rwxr-xr-xpkg/worker_watcher/worker_watcher.go4
1 files changed, 0 insertions, 4 deletions
diff --git a/pkg/worker_watcher/worker_watcher.go b/pkg/worker_watcher/worker_watcher.go
index 170a6ac8..8788e509 100755
--- a/pkg/worker_watcher/worker_watcher.go
+++ b/pkg/worker_watcher/worker_watcher.go
@@ -279,13 +279,11 @@ func (ww *workerWatcher) wait(w worker.BaseProcess) {
const op = errors.Op("process wait")
err := w.Wait()
if err != nil {
- ww.mutex.Lock()
ww.events.Push(events.WorkerEvent{
Event: events.EventWorkerError,
Worker: w,
Payload: errors.E(op, err),
})
- ww.mutex.Unlock()
}
if w.State().Value() == internal.StateDestroyed {
@@ -296,12 +294,10 @@ func (ww *workerWatcher) wait(w worker.BaseProcess) {
_ = ww.stack.FindAndRemoveByPid(w.Pid())
err = ww.AllocateNew()
if err != nil {
- ww.mutex.Lock()
ww.events.Push(events.PoolEvent{
Event: events.EventPoolError,
Payload: errors.E(op, err),
})
- ww.mutex.Unlock()
}
}