Skip to content

Commit

Permalink
address comment
Browse files Browse the repository at this point in the history
Signed-off-by: Cabinfever_B <[email protected]>
  • Loading branch information
CabinfeverB committed Oct 23, 2023
1 parent 9fb345f commit 8c6a990
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -216,11 +216,11 @@ type Server struct {
// related data structures defined in the PD grpc service
pdProtoFactory *tsoutil.PDProtoFactory

serviceRateLimiter *ratelimit.MultiLimiter
serviceRateLimiter *ratelimit.Controller
serviceLabels map[string][]apiutil.AccessPath
apiServiceLabelMap map[apiutil.AccessPath]string

grpcServiceRateLimiter *ratelimit.MultiLimiter
grpcServiceRateLimiter *ratelimit.Controller
grpcServiceLabels map[string]struct{}
grpcServer *grpc.Server

Expand Down Expand Up @@ -273,8 +273,8 @@ func CreateServer(ctx context.Context, cfg *config.Config, services []string, le
audit.NewLocalLogBackend(true),
audit.NewPrometheusHistogramBackend(serviceAuditHistogram, false),
}
s.serviceRateLimiter = ratelimit.NewMultiLimiter()
s.grpcServiceRateLimiter = ratelimit.NewMultiLimiter()
s.serviceRateLimiter = ratelimit.NewController()
s.grpcServiceRateLimiter = ratelimit.NewController()
s.serviceAuditBackendLabels = make(map[string]*audit.BackendLabels)
s.serviceLabels = make(map[string][]apiutil.AccessPath)
s.grpcServiceLabels = make(map[string]struct{})
Expand Down Expand Up @@ -1465,7 +1465,7 @@ func (s *Server) SetServiceAuditBackendLabels(serviceLabel string, labels []stri
}

// GetServiceRateLimiter is used to get rate limiter
func (s *Server) GetServiceRateLimiter() *ratelimit.MultiLimiter {
func (s *Server) GetServiceRateLimiter() *ratelimit.Controller {
return s.serviceRateLimiter
}

Expand All @@ -1480,7 +1480,7 @@ func (s *Server) UpdateServiceRateLimiter(serviceLabel string, opts ...ratelimit
}

// GetGRPCRateLimiter is used to get rate limiter
func (s *Server) GetGRPCRateLimiter() *ratelimit.MultiLimiter {
func (s *Server) GetGRPCRateLimiter() *ratelimit.Controller {
return s.grpcServiceRateLimiter
}

Expand Down

0 comments on commit 8c6a990

Please sign in to comment.