add node change log

This commit is contained in:
yuzuki999 2023-06-19 11:08:15 +08:00
parent 41b06e0bc6
commit ad03c27289
2 changed files with 3 additions and 1 deletions

View File

@ -21,7 +21,7 @@ import (
_ "github.com/xtls/xray-core/app/dns" _ "github.com/xtls/xray-core/app/dns"
_ "github.com/xtls/xray-core/app/dns/fakedns" _ "github.com/xtls/xray-core/app/dns/fakedns"
_ "github.com/xtls/xray-core/app/log" _ "github.com/xtls/xray-core/app/log"
_ "github.com/xtls/xray-core/app/metrics" //_ "github.com/xtls/xray-core/app/metrics"
_ "github.com/xtls/xray-core/app/policy" _ "github.com/xtls/xray-core/app/policy"
_ "github.com/xtls/xray-core/app/reverse" _ "github.com/xtls/xray-core/app/reverse"
_ "github.com/xtls/xray-core/app/router" _ "github.com/xtls/xray-core/app/router"

View File

@ -55,6 +55,7 @@ func (c *Controller) nodeInfoMonitor() (err error) {
if newNodeInfo != nil { if newNodeInfo != nil {
// nodeInfo changed // nodeInfo changed
// Remove old tag // Remove old tag
log.Printf("[%s] Node changed, reload...", c.Tag)
err = c.server.DelNode(c.Tag) err = c.server.DelNode(c.Tag)
if err != nil { if err != nil {
log.Printf("[%s] Del node error: %s", c.Tag, err) log.Printf("[%s] Del node error: %s", c.Tag, err)
@ -107,6 +108,7 @@ func (c *Controller) nodeInfoMonitor() (err error) {
} }
c.nodeInfo = newNodeInfo c.nodeInfo = newNodeInfo
c.userList = newUserInfo c.userList = newUserInfo
log.Printf("[%s] Added %d new users", c.Tag, len(newUserInfo))
// exit // exit
return nil return nil
} }