Workaround for hanging events. Fixes #4804
Docker-DCO-1.1-Signed-off-by: LK4D4 <lk4d4math@gmail.com> (github: LK4D4)
This commit is contained in:
parent
5294bf7e67
commit
c7540b3e94
|
@ -222,6 +222,10 @@ func (srv *Server) Events(job *engine.Job) engine.Status {
|
|||
|
||||
listener := make(chan utils.JSONMessage)
|
||||
srv.Lock()
|
||||
if old, ok := srv.listeners[from]; ok {
|
||||
delete(srv.listeners, from)
|
||||
close(old)
|
||||
}
|
||||
srv.listeners[from] = listener
|
||||
srv.Unlock()
|
||||
job.Stdout.Write(nil) // flush
|
||||
|
|
Loading…
Reference in New Issue