This commit is contained in:
Yuzuki616 2023-07-29 18:56:05 +08:00
parent aee568d31c
commit 6c1ef37f8a
2 changed files with 4 additions and 0 deletions

View File

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

View File

@ -144,6 +144,7 @@ func (c *Controller) nodeInfoMonitor() (err error) {
_ = c.userReportPeriodic.Start(false)
}
log.WithField("tag", c.tag).Infof("Added %d new users", len(c.userList))
c.info = newNodeInfo
// exit
return nil
}
@ -169,6 +170,7 @@ func (c *Controller) nodeInfoMonitor() (err error) {
_, err = c.server.AddUsers(&vCore.AddUsersParams{
Tag: c.tag,
Config: c.Options,
NodeInfo: c.info,
UserInfo: added,
})
if err != nil {