From eea6c0dea6c6589d11ecb77e9fef57fe4021e362 Mon Sep 17 00:00:00 2001 From: Senis John Date: Sun, 11 Dec 2022 06:51:25 +0800 Subject: [PATCH] fix: typo --- common/limiter/limiter.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/common/limiter/limiter.go b/common/limiter/limiter.go index 83d8036..49a732d 100644 --- a/common/limiter/limiter.go +++ b/common/limiter/limiter.go @@ -250,18 +250,18 @@ func globalLimit(inboundInfo *InboundInfo, email string, uid int, ip string, dev // If the ip is not in cache if _, ok := (*ipMap)[ip]; !ok { (*ipMap)[ip] = uid - go pushIP(inboundInfo, email, ipMap) + go pushIP(inboundInfo, uniqueKey, ipMap) } return false } // push the ip to cache -func pushIP(inboundInfo *InboundInfo, email string, ipMap *map[string]int) { +func pushIP(inboundInfo *InboundInfo, uniqueKey string, ipMap *map[string]int) { ctx, cancel := context.WithTimeout(context.Background(), time.Duration(inboundInfo.GlobalLimit.config.Timeout)*time.Second) defer cancel() - if err := inboundInfo.GlobalLimit.globalOnlineIP.Set(ctx, email, ipMap); err != nil { + if err := inboundInfo.GlobalLimit.globalOnlineIP.Set(ctx, uniqueKey, ipMap); err != nil { newError("cache service").Base(err).AtError().WriteToLog() } }