Skip to content

Commit

Permalink
Fix/fix router (#53)
Browse files Browse the repository at this point in the history
* fix: barry 2024-11-14 22:20:09

* fix: barry 2024-11-14 22:20:39

* fix: barry 2024-11-14 22:21:31
  • Loading branch information
kooksee authored Nov 14, 2024
1 parent b018673 commit 585d8d6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion internal/middlewares/middleware_metric/middleware.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package middleware_metric

import (
"context"
"strings"
"time"

"github.com/pubgo/funk/generic"
Expand Down Expand Up @@ -48,8 +49,11 @@ func (m MetricMiddleware) String() string { return "metric" }

func (m MetricMiddleware) Middleware(next lava.HandlerFunc) lava.HandlerFunc {
return func(ctx context.Context, req lava.Request) (rsp lava.Response, gErr error) {
now := time.Now()
if req.Kind() == "http" || strings.Contains(req.Operation(), " ") {
return next(ctx, req)
}

now := time.Now()
grpcServerRpcCallTotal(m.m, req.Operation())

defer func() {
Expand Down

0 comments on commit 585d8d6

Please sign in to comment.