Skip to content

Commit

Permalink
Merge pull request #408 from fluxcd/fix/context
Browse files Browse the repository at this point in the history
Fix context cancel defer for commit status updates
  • Loading branch information
stefanprodan authored Aug 29, 2022
2 parents 57128d9 + 82253a9 commit afb7ad8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions internal/server/event_handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,8 @@ func (s *EventServer) handleEvent() func(w http.ResponseWriter, r *http.Request)
}

go func(n notifier.Interface, e events.Event) {
ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second)
defer cancel()
if err := n.Post(ctx, e); err != nil {
maskedErrStr, maskErr := masktoken.MaskTokenFromString(err.Error(), token)
if maskErr != nil {
Expand Down

0 comments on commit afb7ad8

Please sign in to comment.