mirror of
https://github.com/wyx2685/V2bX.git
synced 2025-01-22 18:08:14 -05:00
fix report interval
This commit is contained in:
parent
3f6f80b5e5
commit
13607c104d
@ -15,24 +15,24 @@ import (
|
||||
func (c *Controller) initTask() {
|
||||
// fetch node info task
|
||||
c.nodeInfoMonitorPeriodic = &task.Periodic{
|
||||
Interval: time.Duration(c.nodeInfo.BaseConfig.PullInterval.(int)) * time.Second,
|
||||
Interval: c.nodeInfo.BaseConfig.PullInterval.(time.Duration),
|
||||
Execute: c.nodeInfoMonitor,
|
||||
}
|
||||
// fetch user list task
|
||||
c.userReportPeriodic = &task.Periodic{
|
||||
Interval: time.Duration(c.nodeInfo.BaseConfig.PushInterval.(int)) * time.Second,
|
||||
Interval: c.nodeInfo.BaseConfig.PushInterval.(time.Duration),
|
||||
Execute: c.reportUserTraffic,
|
||||
}
|
||||
log.Printf("[%s: %d] Start monitor node status", c.nodeInfo.NodeType, c.nodeInfo.NodeId)
|
||||
// delay to start nodeInfoMonitor
|
||||
go func() {
|
||||
time.Sleep(time.Duration(c.nodeInfo.BaseConfig.PullInterval.(int)) * time.Second)
|
||||
time.Sleep(c.nodeInfo.BaseConfig.PullInterval.(time.Duration))
|
||||
_ = c.nodeInfoMonitorPeriodic.Start()
|
||||
}()
|
||||
log.Printf("[%s: %d] Start report node status", c.nodeInfo.NodeType, c.nodeInfo.NodeId)
|
||||
// delay to start userReport
|
||||
go func() {
|
||||
time.Sleep(time.Duration(c.nodeInfo.BaseConfig.PushInterval.(int)) * time.Second)
|
||||
time.Sleep(c.nodeInfo.BaseConfig.PushInterval.(time.Duration))
|
||||
_ = c.userReportPeriodic.Start()
|
||||
}()
|
||||
if c.nodeInfo.Tls != 0 && c.CertConfig.CertMode != "none" &&
|
||||
|
Loading…
Reference in New Issue
Block a user