1
0
mirror of https://github.com/imgproxy/imgproxy.git synced 2025-02-12 11:46:10 +02:00

Respond with 499 is a client closed the connection

This commit is contained in:
DarthSim 2020-01-31 20:00:05 +06:00
parent 20c33ad273
commit e31950e1ef

View File

@ -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)
}