mirror of
https://github.com/wyx2685/V2bX.git
synced 2025-01-23 18:38:12 -05:00
add started log
This commit is contained in:
parent
38081e14c2
commit
1ad7bf5d83
@ -77,12 +77,14 @@ func serverHandle(_ *cobra.Command, _ []string) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
defer vc.Close()
|
defer vc.Close()
|
||||||
|
log.Info("Core ", vc.Type(), " started")
|
||||||
nodes := node.New()
|
nodes := node.New()
|
||||||
err = nodes.Start(c.NodeConfig, vc)
|
err = nodes.Start(c.NodeConfig, vc)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.WithField("err", err).Error("Run nodes failed")
|
log.WithField("err", err).Error("Run nodes failed")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
log.Info("Nodes started")
|
||||||
dns := os.Getenv("XRAY_DNS_PATH")
|
dns := os.Getenv("XRAY_DNS_PATH")
|
||||||
if watch {
|
if watch {
|
||||||
err = c.Watch(config, dns, func() {
|
err = c.Watch(config, dns, func() {
|
||||||
@ -102,11 +104,13 @@ func serverHandle(_ *cobra.Command, _ []string) {
|
|||||||
log.WithField("err", err).Error("Start core failed")
|
log.WithField("err", err).Error("Start core failed")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
log.Info("Core ", vc.Type(), " restarted")
|
||||||
err = nodes.Start(c.NodeConfig, vc)
|
err = nodes.Start(c.NodeConfig, vc)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.WithField("err", err).Error("Run nodes failed")
|
log.WithField("err", err).Error("Run nodes failed")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
log.Info("Nodes restarted")
|
||||||
runtime.GC()
|
runtime.GC()
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -87,6 +87,7 @@ func (o *Options) UnmarshalJSON(data []byte) error {
|
|||||||
o.SingOptions = NewSingOptions()
|
o.SingOptions = NewSingOptions()
|
||||||
return json.Unmarshal(data, o.SingOptions)
|
return json.Unmarshal(data, o.SingOptions)
|
||||||
default:
|
default:
|
||||||
|
o.Core = ""
|
||||||
o.RawOptions = data
|
o.RawOptions = data
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
|
@ -108,5 +108,13 @@ func (s *Selector) Protocols() []string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (s *Selector) Type() string {
|
func (s *Selector) Type() string {
|
||||||
return "selector"
|
t := "Selector("
|
||||||
|
for i := range s.cores {
|
||||||
|
if i != 0 {
|
||||||
|
t += " "
|
||||||
|
}
|
||||||
|
t += s.cores[i].Type()
|
||||||
|
}
|
||||||
|
t += ")"
|
||||||
|
return t
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user