Skip to content

Commit ab0fcd8

Browse files
Fixes metrics also with regular request timeouts. (#1550)
1 parent 2f7b987 commit ab0fcd8

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

context.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,9 +152,9 @@ func (fc *frankenPHPContext) reject(statusCode int, message string) {
152152
if rw != nil {
153153
rw.WriteHeader(statusCode)
154154
_, _ = rw.Write([]byte(message))
155-
155+
156156
if f, ok := rw.(http.Flusher); ok {
157-
f.Flush()
157+
f.Flush()
158158
}
159159
}
160160

threadregular.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ func handleRequestWithRegularPHPThreads(fc *frankenPHPContext) {
118118
// the request has triggered scaling, continue to wait for a thread
119119
case <-timeoutChan(maxWaitTime):
120120
// the request has timed out stalling
121+
metrics.DequeuedRequest()
121122
fc.reject(504, "Gateway Timeout")
122123
return
123124
}

0 commit comments

Comments
 (0)