mirror of
https://github.com/v2fly/v2ray-core.git
synced 2024-12-21 09:36:34 -05:00
remove unnecessary id cache
This commit is contained in:
parent
ee5bc8133a
commit
deb7dab8f3
@ -47,7 +47,7 @@ func NewTimedUserValidator(hasher protocol.IDHash) protocol.UserValidator {
|
||||
users: make([]*user, 0, 16),
|
||||
userHash: make(map[[16]byte]indexTimePair, 1024),
|
||||
hasher: hasher,
|
||||
baseTime: protocol.Timestamp(time.Now().Unix() - cacheDurationSec*3),
|
||||
baseTime: protocol.Timestamp(time.Now().Unix() - cacheDurationSec*2),
|
||||
}
|
||||
tuv.task = &signal.PeriodicTask{
|
||||
Interval: updateInterval,
|
||||
@ -105,7 +105,7 @@ func (v *TimedUserValidator) updateUserHash() {
|
||||
v.generateNewHashes(nowSec, user)
|
||||
}
|
||||
|
||||
expire := protocol.Timestamp(now.Unix() - cacheDurationSec*3)
|
||||
expire := protocol.Timestamp(now.Unix() - cacheDurationSec)
|
||||
if expire > v.baseTime {
|
||||
v.removeExpiredHashes(uint32(expire - v.baseTime))
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user