mirror of
https://github.com/v2fly/v2ray-core.git
synced 2025-10-08 10:04:03 -04:00
unified task package
This commit is contained in:
@@ -19,7 +19,7 @@ import (
|
||||
"v2ray.com/core/common/net"
|
||||
"v2ray.com/core/common/protocol"
|
||||
"v2ray.com/core/common/serial"
|
||||
"v2ray.com/core/common/signal"
|
||||
"v2ray.com/core/common/task"
|
||||
"v2ray.com/core/proxy/vmess"
|
||||
)
|
||||
|
||||
@@ -33,7 +33,7 @@ type sessionId struct {
|
||||
type SessionHistory struct {
|
||||
sync.RWMutex
|
||||
cache map[sessionId]time.Time
|
||||
task *signal.PeriodicTask
|
||||
task *task.Periodic
|
||||
}
|
||||
|
||||
// NewSessionHistory creates a new SessionHistory object.
|
||||
@@ -41,7 +41,7 @@ func NewSessionHistory() *SessionHistory {
|
||||
h := &SessionHistory{
|
||||
cache: make(map[sessionId]time.Time, 128),
|
||||
}
|
||||
h.task = &signal.PeriodicTask{
|
||||
h.task = &task.Periodic{
|
||||
Interval: time.Second * 30,
|
||||
Execute: func() error {
|
||||
h.removeExpiredEntries()
|
||||
|
Reference in New Issue
Block a user