Skip to content

Commit

Permalink
enhance: remove the invalid log (milvus-io#35465)
Browse files Browse the repository at this point in the history
/kind improvement

Signed-off-by: SimFG <[email protected]>
  • Loading branch information
SimFG authored Aug 14, 2024
1 parent 0868a97 commit 0400eb9
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions internal/proxy/hook_interceptor.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (

func UnaryServerHookInterceptor() grpc.UnaryServerInterceptor {
return func(ctx context.Context, req any, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error) {
return HookInterceptor(ctx, req, getCurrentUser(ctx), info.FullMethod, handler)
return HookInterceptor(ctx, req, GetCurUserFromContextOrDefault(ctx), info.FullMethod, handler)
}
}

Expand Down Expand Up @@ -66,11 +66,3 @@ func updateProxyFunctionCallMetric(fullMethod string) {
metrics.ProxyFunctionCall.WithLabelValues(strconv.FormatInt(paramtable.GetNodeID(), 10), method, metrics.TotalLabel, "", "").Inc()
metrics.ProxyFunctionCall.WithLabelValues(strconv.FormatInt(paramtable.GetNodeID(), 10), method, metrics.FailLabel, "", "").Inc()
}

func getCurrentUser(ctx context.Context) string {
username, err := GetCurUserFromContext(ctx)
if err != nil {
log.Warn("fail to get current user", zap.Error(err))
}
return username
}

0 comments on commit 0400eb9

Please sign in to comment.