1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2025-12-28 04:55:37 -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

@@ -10,7 +10,7 @@ import (
"v2ray.com/core/app/proxyman/mux"
"v2ray.com/core/common/dice"
"v2ray.com/core/common/net"
"v2ray.com/core/common/signal"
"v2ray.com/core/common/task"
"v2ray.com/core/proxy"
)
@@ -25,7 +25,7 @@ type DynamicInboundHandler struct {
worker []worker
lastRefresh time.Time
mux *mux.Server
task *signal.PeriodicTask
task *task.Periodic
}
func NewDynamicInboundHandler(ctx context.Context, tag string, receiverConfig *proxyman.ReceiverConfig, proxyConfig interface{}) (*DynamicInboundHandler, error) {
@@ -39,7 +39,7 @@ func NewDynamicInboundHandler(ctx context.Context, tag string, receiverConfig *p
v: v,
}
h.task = &signal.PeriodicTask{
h.task = &task.Periodic{
Interval: time.Minute * time.Duration(h.receiverConfig.AllocationStrategy.GetRefreshValue()),
Execute: h.refresh,
}