File tree Expand file tree Collapse file tree 1 file changed +8
-9
lines changed Expand file tree Collapse file tree 1 file changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -127,6 +127,14 @@ func dumpRequest(r *http.Request) string {
127127 return string (reqContent )
128128}
129129
130+ func getSlowThreshold (r * http.Request ) time.Duration {
131+ if r .Header .Get (headerAccept ) == valueSSE {
132+ return sseSlowThreshold .Load ()
133+ } else {
134+ return slowThreshold .Load ()
135+ }
136+ }
137+
130138func isOkResponse (code int ) bool {
131139 // not server error
132140 return code < http .StatusInternalServerError
@@ -234,12 +242,3 @@ func wrapStatusCode(code int) string {
234242
235243 return logx .WithColorPadding (strconv .Itoa (code ), colour )
236244}
237-
238- func getSlowThreshold (r * http.Request ) time.Duration {
239- threshold := slowThreshold .Load ()
240- if r .Header .Get (headerAccept ) == valueSSE {
241- threshold = sseSlowThreshold .Load ()
242- }
243-
244- return threshold
245- }
You can’t perform that action at this time.
0 commit comments