mirror of
https://github.com/XrayR-project/XrayR.git
synced 2025-06-08 05:19:54 +00:00
fix: init global limit
This commit is contained in:
parent
b47954ea64
commit
a397af5d73
@ -143,8 +143,8 @@ func (l *Limiter) GetUserBucket(tag string, email string, ip string) (limiter *r
|
|||||||
inboundInfo := value.(*InboundInfo)
|
inboundInfo := value.(*InboundInfo)
|
||||||
nodeLimit := inboundInfo.NodeSpeedLimit
|
nodeLimit := inboundInfo.NodeSpeedLimit
|
||||||
var (
|
var (
|
||||||
userLimit uint64 = 0
|
userLimit uint64 = 0
|
||||||
deviceLimit, uid, globalDeviceLimit int
|
deviceLimit, uid int
|
||||||
)
|
)
|
||||||
|
|
||||||
if v, ok := inboundInfo.UserInfo.Load(email); ok {
|
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
|
// Global device limit
|
||||||
if globalDeviceLimit > 0 {
|
if l.g.limit > 0 {
|
||||||
ctx, cancel := context.WithTimeout(context.Background(), time.Second*5)
|
ctx, cancel := context.WithTimeout(context.Background(), time.Second*5)
|
||||||
defer cancel()
|
defer cancel()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user