提交 b72afd30 authored 作者: mooncake's avatar mooncake

not ignore 404

上级 7f544171
...@@ -3,7 +3,6 @@ package xgin ...@@ -3,7 +3,6 @@ package xgin
import ( import (
"context" "context"
"fmt" "fmt"
"net/http"
"time" "time"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
...@@ -77,10 +76,10 @@ func New() *gin.Engine { ...@@ -77,10 +76,10 @@ func New() *gin.Engine {
jwt.WithSigningMethod(jwt.HS256), jwt.WithSigningMethod(jwt.HS256),
) )
} }
// not ignore 404
if app.Middleware.EnableMetrics { if app.Middleware.EnableMetrics {
r.Use(metrics.Metrics(r, r.Use(metrics.Metrics(r)) // metrics.WithIgnoreStatusCodes(http.StatusNotFound), // ignore 404 status codes
metrics.WithIgnoreStatusCodes(http.StatusNotFound), // ignore 404 status codes
))
} }
if app.Middleware.EnableLimit { if app.Middleware.EnableLimit {
r.Use(middleware.RateLimit()) r.Use(middleware.RateLimit())
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论