Sfoglia il codice sorgente

排除客户端中断导致的503错误 (#1343)

vic 3 anni fa
parent
commit
2cdf5e7395
1 ha cambiato i file con 1 aggiunte e 1 eliminazioni
  1. 1 1
      rest/handler/loghandler.go

+ 1 - 1
rest/handler/loghandler.go

@@ -185,7 +185,7 @@ func logBrief(r *http.Request, code int, timer *utils.ElapsedTimer, logs *intern
 		buf.WriteString(fmt.Sprintf("\n%s", body))
 	}
 
-	if ok {
+	if ok || r.Context().Err() == context.Canceled  {
 		logger.Info(buf.String())
 	} else {
 		logger.Error(buf.String())