v1.5.1 增强程序稳定性
This commit is contained in:
@@ -51,14 +51,14 @@ func (this *Node) reloadCommonScripts() error {
|
||||
return err
|
||||
}
|
||||
if len(configsResp.ScriptConfigsJSON) == 0 {
|
||||
sharedNodeConfig.CommonScripts = nil
|
||||
nodeConfig().CommonScripts = nil
|
||||
} else {
|
||||
var configs = []*serverconfigs.CommonScript{}
|
||||
err = json.Unmarshal(configsResp.ScriptConfigsJSON, &configs)
|
||||
if err != nil {
|
||||
return fmt.Errorf("decode script configs failed: %w", err)
|
||||
}
|
||||
sharedNodeConfig.CommonScripts = configs
|
||||
nodeConfig().CommonScripts = configs
|
||||
}
|
||||
|
||||
// 通知更新
|
||||
@@ -71,13 +71,20 @@ func (this *Node) reloadCommonScripts() error {
|
||||
}
|
||||
|
||||
func (this *Node) reloadIPLibrary() {
|
||||
if sharedNodeConfig.Edition == lastEdition {
|
||||
var cfg = nodeConfig()
|
||||
if cfg.Edition == lastEdition {
|
||||
return
|
||||
}
|
||||
|
||||
go func() {
|
||||
defer func() {
|
||||
if r := recover(); r != nil {
|
||||
remotelogs.Error("IP_LIBRARY", fmt.Sprintf("goroutine panic: %v", r))
|
||||
}
|
||||
}()
|
||||
|
||||
var err error
|
||||
lastEdition = sharedNodeConfig.Edition
|
||||
lastEdition = cfg.Edition
|
||||
if len(lastEdition) > 0 && (lists.ContainsString([]string{"pro", "ent", "max", "ultra"}, lastEdition)) {
|
||||
err = iplib.InitPlus()
|
||||
} else {
|
||||
@@ -100,11 +107,12 @@ func (this *Node) notifyPlusChange() error {
|
||||
return err
|
||||
}
|
||||
|
||||
var isChanged = resp.Edition != sharedNodeConfig.Edition
|
||||
var cfg = nodeConfig()
|
||||
var isChanged = resp.Edition != cfg.Edition
|
||||
if resp.IsPlus {
|
||||
sharedNodeConfig.Edition = resp.Edition
|
||||
cfg.Edition = resp.Edition
|
||||
} else {
|
||||
sharedNodeConfig.Edition = ""
|
||||
cfg.Edition = ""
|
||||
}
|
||||
|
||||
if isChanged {
|
||||
|
||||
Reference in New Issue
Block a user