mirror of
https://github.com/wyx2685/V2bX.git
synced 2025-01-23 18:38:12 -05:00
尝试修复自动重载配置不成功的BUG
This commit is contained in:
parent
330f3b1449
commit
41b7cf8eb9
@ -1,6 +1,11 @@
|
|||||||
package cmd
|
package cmd
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"os"
|
||||||
|
"os/signal"
|
||||||
|
"runtime"
|
||||||
|
"syscall"
|
||||||
|
|
||||||
"github.com/InazumaV/V2bX/conf"
|
"github.com/InazumaV/V2bX/conf"
|
||||||
vCore "github.com/InazumaV/V2bX/core"
|
vCore "github.com/InazumaV/V2bX/core"
|
||||||
"github.com/InazumaV/V2bX/limiter"
|
"github.com/InazumaV/V2bX/limiter"
|
||||||
@ -8,10 +13,6 @@ import (
|
|||||||
log "github.com/sirupsen/logrus"
|
log "github.com/sirupsen/logrus"
|
||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
"gopkg.in/natefinch/lumberjack.v2"
|
"gopkg.in/natefinch/lumberjack.v2"
|
||||||
"os"
|
|
||||||
"os/signal"
|
|
||||||
"runtime"
|
|
||||||
"syscall"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@ -95,6 +96,7 @@ func serverHandle(_ *cobra.Command, _ []string) {
|
|||||||
log.WithField("err", err).Error("Restart node failed")
|
log.WithField("err", err).Error("Restart node failed")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
runtime.GC()
|
||||||
vc, err = vCore.NewCore(c.CoresConfig)
|
vc, err = vCore.NewCore(c.CoresConfig)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.WithField("err", err).Error("New core failed")
|
log.WithField("err", err).Error("New core failed")
|
||||||
@ -112,7 +114,6 @@ func serverHandle(_ *cobra.Command, _ []string) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
log.Info("Nodes restarted")
|
log.Info("Nodes restarted")
|
||||||
runtime.GC()
|
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.WithField("err", err).Error("start watch failed")
|
log.WithField("err", err).Error("start watch failed")
|
||||||
|
@ -110,6 +110,10 @@ func (c *Controller) Close() error {
|
|||||||
if c.onlineIpReportPeriodic != nil {
|
if c.onlineIpReportPeriodic != nil {
|
||||||
c.onlineIpReportPeriodic.Close()
|
c.onlineIpReportPeriodic.Close()
|
||||||
}
|
}
|
||||||
|
err := c.server.DelNode(c.tag)
|
||||||
|
if err != nil {
|
||||||
|
return fmt.Errorf("del node error: %s", err)
|
||||||
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user