Skip to content

Commit

Permalink
Fix context cancel defer
Browse files Browse the repository at this point in the history
Signed-off-by: Philip Laine <philip.laine@gmail.com>
  • Loading branch information
phillebaba committed Aug 26, 2022
1 parent 57128d9 commit 82253a9
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 82253a9

Please sign in to comment.