This commit is contained in:
Yuzuki616 2023-07-29 19:17:13 +08:00
parent 42a7ab6f43
commit 04cbd2e955
2 changed files with 3 additions and 0 deletions

View File

@ -20,6 +20,7 @@ type Controller struct {
limiter *limiter.Limiter limiter *limiter.Limiter
traffic map[string]int64 traffic map[string]int64
userList []panel.UserInfo userList []panel.UserInfo
info *panel.NodeInfo
ipRecorder iprecoder.IpRecorder ipRecorder iprecoder.IpRecorder
nodeInfoMonitorPeriodic *task.Task nodeInfoMonitorPeriodic *task.Task
userReportPeriodic *task.Task userReportPeriodic *task.Task
@ -85,6 +86,7 @@ func (c *Controller) Start() error {
return fmt.Errorf("add users error: %s", err) return fmt.Errorf("add users error: %s", err)
} }
log.WithField("tag", c.tag).Infof("Added %d new users", added) log.WithField("tag", c.tag).Infof("Added %d new users", added)
c.info = node
c.startTasks(node) c.startTasks(node)
return nil return nil
} }

View File

@ -144,6 +144,7 @@ func (c *Controller) nodeInfoMonitor() (err error) {
_ = c.userReportPeriodic.Start(false) _ = c.userReportPeriodic.Start(false)
} }
log.WithField("tag", c.tag).Infof("Added %d new users", len(c.userList)) log.WithField("tag", c.tag).Infof("Added %d new users", len(c.userList))
c.info = newNodeInfo
// exit // exit
return nil return nil
} }