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() {
|
func (c *Controller) initTask() {
|
||||||
// fetch node info task
|
// fetch node info task
|
||||||
c.nodeInfoMonitorPeriodic = &task.Periodic{
|
c.nodeInfoMonitorPeriodic = &task.Periodic{
|
||||||
Interval: time.Duration(c.nodeInfo.BaseConfig.PullInterval.(int)) * time.Second,
|
Interval: c.nodeInfo.BaseConfig.PullInterval.(time.Duration),
|
||||||
Execute: c.nodeInfoMonitor,
|
Execute: c.nodeInfoMonitor,
|
||||||
}
|
}
|
||||||
// fetch user list task
|
// fetch user list task
|
||||||
c.userReportPeriodic = &task.Periodic{
|
c.userReportPeriodic = &task.Periodic{
|
||||||
Interval: time.Duration(c.nodeInfo.BaseConfig.PushInterval.(int)) * time.Second,
|
Interval: c.nodeInfo.BaseConfig.PushInterval.(time.Duration),
|
||||||
Execute: c.reportUserTraffic,
|
Execute: c.reportUserTraffic,
|
||||||
}
|
}
|
||||||
log.Printf("[%s: %d] Start monitor node status", c.nodeInfo.NodeType, c.nodeInfo.NodeId)
|
log.Printf("[%s: %d] Start monitor node status", c.nodeInfo.NodeType, c.nodeInfo.NodeId)
|
||||||
// delay to start nodeInfoMonitor
|
// delay to start nodeInfoMonitor
|
||||||
go func() {
|
go func() {
|
||||||
time.Sleep(time.Duration(c.nodeInfo.BaseConfig.PullInterval.(int)) * time.Second)
|
time.Sleep(c.nodeInfo.BaseConfig.PullInterval.(time.Duration))
|
||||||
_ = c.nodeInfoMonitorPeriodic.Start()
|
_ = c.nodeInfoMonitorPeriodic.Start()
|
||||||
}()
|
}()
|
||||||
log.Printf("[%s: %d] Start report node status", c.nodeInfo.NodeType, c.nodeInfo.NodeId)
|
log.Printf("[%s: %d] Start report node status", c.nodeInfo.NodeType, c.nodeInfo.NodeId)
|
||||||
// delay to start userReport
|
// delay to start userReport
|
||||||
go func() {
|
go func() {
|
||||||
time.Sleep(time.Duration(c.nodeInfo.BaseConfig.PushInterval.(int)) * time.Second)
|
time.Sleep(c.nodeInfo.BaseConfig.PushInterval.(time.Duration))
|
||||||
_ = c.userReportPeriodic.Start()
|
_ = c.userReportPeriodic.Start()
|
||||||
}()
|
}()
|
||||||
if c.nodeInfo.Tls != 0 && c.CertConfig.CertMode != "none" &&
|
if c.nodeInfo.Tls != 0 && c.CertConfig.CertMode != "none" &&
|
||||||
|
Loading…
Reference in New Issue
Block a user