fix(*) handle closed channel to allow plugins to terminate processing (#16)

This commit is contained in:
Javier
2020-01-24 18:20:04 -05:00
committed by Guilherme Salazar
parent dec2701f43
commit 9dd9b0ffec

View File

@@ -59,12 +59,16 @@ func (s *PluginServer) HandleEvent(in StartEventData, out *StepData) error {
go func() {
_ = <-ipc
h(event.pdk)
ipc <- "ret"
func() {
defer func() { recover() }()
ipc <- "ret"
}()
s.lock.Lock()
defer s.lock.Unlock()
event.instance.lastEvent = time.Now()
delete(s.events, event.id)
s.lock.Unlock()
}()
ipc <- "run" // kickstart the handler