1
0
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:
Darien Raymond
2018-05-27 13:02:29 +02:00
parent 7fa4bb434b
commit 13f3c356ca
21 changed files with 252 additions and 66 deletions

View File

@@ -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()