fix server not being restarted after config reload

This commit is contained in:
yusing 2025-02-04 07:02:28 +08:00
parent 4d7422dd90
commit 7c56c88dd4

View file

@ -125,7 +125,7 @@ func Reload() E.Error {
// -> replace config -> start new subtasks // -> replace config -> start new subtasks
instance.task.Finish("config changed") instance.task.Finish("config changed")
instance = newCfg instance = newCfg
instance.Start() instance.Start(StartAllServers)
return nil return nil
} }
@ -184,6 +184,8 @@ type StartServersOptions struct {
Proxy, API bool Proxy, API bool
} }
var StartAllServers = &StartServersOptions{true, true}
func (cfg *Config) StartServers(opts ...*StartServersOptions) { func (cfg *Config) StartServers(opts ...*StartServersOptions) {
if len(opts) == 0 { if len(opts) == 0 {
opts = append(opts, &StartServersOptions{}) opts = append(opts, &StartServersOptions{})