Skip to content

Commit

Permalink
[fix] Fix engine panic when we get a zero response (#12890)
Browse files Browse the repository at this point in the history
  • Loading branch information
cedric-cordenier authored Apr 19, 2024
1 parent b2cd7ff commit facaf9a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion core/services/workflows/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,12 @@ func (e *Engine) loop(ctx context.Context) {
case <-ctx.Done():
e.logger.Debugw("shutting down loop")
return
case resp := <-e.triggerEvents:
case resp, isOpen := <-e.triggerEvents:
if !isOpen {
e.logger.Errorf("trigger events channel is no longer open, skipping")
continue
}

if resp.Err != nil {
e.logger.Errorf("trigger event was an error; not executing", resp.Err)
continue
Expand Down

0 comments on commit facaf9a

Please sign in to comment.