fix: init global limit

This commit is contained in:
Senis 2022-11-04 14:36:34 +08:00
parent b47954ea64
commit a397af5d73

View File

@ -144,7 +144,7 @@ func (l *Limiter) GetUserBucket(tag string, email string, ip string) (limiter *r
nodeLimit := inboundInfo.NodeSpeedLimit
var (
userLimit uint64 = 0
deviceLimit, uid, globalDeviceLimit int
deviceLimit, uid int
)
if v, ok := inboundInfo.UserInfo.Load(email); ok {
@ -155,7 +155,7 @@ func (l *Limiter) GetUserBucket(tag string, email string, ip string) (limiter *r
}
// Global device limit
if globalDeviceLimit > 0 {
if l.g.limit > 0 {
ctx, cancel := context.WithTimeout(context.Background(), time.Second*5)
defer cancel()