mirror of
https://github.com/wyx2685/V2bX.git
synced 2026-02-04 04:30:08 +00:00
fix: 用户限速信息不能同步更新BUG
This commit is contained in:
@@ -24,11 +24,11 @@ type Limiter struct {
|
|||||||
DomainRules []*regexp.Regexp
|
DomainRules []*regexp.Regexp
|
||||||
ProtocolRules []string
|
ProtocolRules []string
|
||||||
SpeedLimit int
|
SpeedLimit int
|
||||||
UserOnlineIP *sync.Map // Key: Name, value: {Key: Ip, value: Uid}
|
UserOnlineIP *sync.Map // Key: TagUUID, value: {Key: Ip, value: Uid}
|
||||||
OldUserOnline *sync.Map // Key: Ip, value: Uid
|
OldUserOnline *sync.Map // Key: Ip, value: Uid
|
||||||
UUIDtoUID map[string]int // Key: UUID, value: Uid
|
UUIDtoUID map[string]int // Key: UUID, value: Uid
|
||||||
UserLimitInfo *sync.Map // Key: Uid value: UserLimitInfo
|
UserLimitInfo *sync.Map // Key: TagUUID value: UserLimitInfo
|
||||||
SpeedLimiter *sync.Map // key: Uid, value: *ratelimit.Bucket
|
SpeedLimiter *sync.Map // key: TagUUID, value: *ratelimit.Bucket
|
||||||
AliveList map[int]int // Key: Uid, value: alive_ip
|
AliveList map[int]int // Key: Uid, value: alive_ip
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -91,6 +91,7 @@ func (l *Limiter) UpdateUser(tag string, added []panel.UserInfo, deleted []panel
|
|||||||
for i := range deleted {
|
for i := range deleted {
|
||||||
l.UserLimitInfo.Delete(format.UserTag(tag, deleted[i].Uuid))
|
l.UserLimitInfo.Delete(format.UserTag(tag, deleted[i].Uuid))
|
||||||
l.UserOnlineIP.Delete(format.UserTag(tag, deleted[i].Uuid))
|
l.UserOnlineIP.Delete(format.UserTag(tag, deleted[i].Uuid))
|
||||||
|
l.SpeedLimiter.Delete(format.UserTag(tag, deleted[i].Uuid))
|
||||||
delete(l.UUIDtoUID, deleted[i].Uuid)
|
delete(l.UUIDtoUID, deleted[i].Uuid)
|
||||||
delete(l.AliveList, deleted[i].Id)
|
delete(l.AliveList, deleted[i].Id)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user