Skip to content
Permalink
Browse files

Respond with 499 is a client closed the connection

  • Loading branch information
DarthSim committed Jan 31, 2020
1 parent 20c33ad commit e31950e1ef325166961e5234c057d99fc86ef602
Showing with 4 additions and 0 deletions.
  1. +4 −0 timer.go
@@ -21,6 +21,10 @@ func checkTimeout(ctx context.Context) {
case <-ctx.Done():
d := getTimerSince(ctx)

if ctx.Err() != context.DeadlineExceeded {
panic(newError(499, fmt.Sprintf("Request was cancelled after %v", d), "Cancelled"))
}

if newRelicEnabled {
sendTimeoutToNewRelic(ctx, d)
}

0 comments on commit e31950e

Please sign in to comment.
You can’t perform that action at this time.