mirror of
https://github.com/v2fly/v2ray-core.git
synced 2025-12-27 04:25:44 -05:00
unified task package
This commit is contained in:
@@ -14,7 +14,7 @@ import (
|
||||
|
||||
"v2ray.com/core/common"
|
||||
"v2ray.com/core/common/protocol"
|
||||
"v2ray.com/core/common/signal"
|
||||
"v2ray.com/core/common/task"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -34,7 +34,7 @@ type TimedUserValidator struct {
|
||||
userHash map[[16]byte]indexTimePair
|
||||
hasher protocol.IDHash
|
||||
baseTime protocol.Timestamp
|
||||
task *signal.PeriodicTask
|
||||
task *task.Periodic
|
||||
}
|
||||
|
||||
type indexTimePair struct {
|
||||
@@ -49,7 +49,7 @@ func NewTimedUserValidator(hasher protocol.IDHash) *TimedUserValidator {
|
||||
hasher: hasher,
|
||||
baseTime: protocol.Timestamp(time.Now().Unix() - cacheDurationSec*2),
|
||||
}
|
||||
tuv.task = &signal.PeriodicTask{
|
||||
tuv.task = &task.Periodic{
|
||||
Interval: updateInterval,
|
||||
Execute: func() error {
|
||||
tuv.updateUserHash()
|
||||
|
||||
Reference in New Issue
Block a user