From 0fea7f9cb810e5385087000bdfbb02754af3ccc1 Mon Sep 17 00:00:00 2001 From: dylanyang Date: Mon, 4 Mar 2024 20:36:29 +0800 Subject: [PATCH] update --- rpc_server/middlewares/rate_limit.go | 4 ++-- rpc_server/routers/boot.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/rpc_server/middlewares/rate_limit.go b/rpc_server/middlewares/rate_limit.go index 857d308b..0d52d82d 100644 --- a/rpc_server/middlewares/rate_limit.go +++ b/rpc_server/middlewares/rate_limit.go @@ -15,8 +15,8 @@ const ( var limiter map[string]*rate.Limiter -// RateLimiterByApiKeyByHandler represents the rate limit by each ApiKey for each api calling -func RateLimiterByApiKeyByHandler() gin.HandlerFunc { +// RateLimiterByApiKeyHandler represents the rate limit by each ApiKey for each api calling +func RateLimiterByApiKeyHandler() gin.HandlerFunc { return func(ctx *gin.Context) { if exists, current := utils.CurrentUser(ctx); exists { diff --git a/rpc_server/routers/boot.go b/rpc_server/routers/boot.go index 2ac115bc..effb2211 100644 --- a/rpc_server/routers/boot.go +++ b/rpc_server/routers/boot.go @@ -60,7 +60,7 @@ func generateHandlers() []gin.HandlerFunc { } handlers = append(handlers, middlewares.CorsHandler()) handlers = append(handlers, middlewares.AuthHandler()) - handlers = append(handlers, middlewares.RateLimiterByApiKeyByHandler()) + handlers = append(handlers, middlewares.RateLimiterByApiKeyHandler()) return handlers }