MCPcopy Create free account
hub / github.com/GoEdgeLab/EdgeNode / execGlobalServerConfigChangedTask

Method execGlobalServerConfigChangedTask

internal/nodes/node_tasks.go:213–236  ·  view source on GitHub ↗

服务全局配置变更

(rpcClient *rpc.RPCClient)

Source from the content-addressed store, hash-verified

211
212// 服务全局配置变更
213func (this *Node) execGlobalServerConfigChangedTask(rpcClient *rpc.RPCClient) error {
214 resp, err := rpcClient.NodeRPC.FindNodeGlobalServerConfig(rpcClient.Context(), &pb.FindNodeGlobalServerConfigRequest{})
215 if err != nil {
216 return err
217 }
218 if len(resp.GlobalServerConfigJSON) > 0 {
219 var globalServerConfig = serverconfigs.NewGlobalServerConfig()
220 err = json.Unmarshal(resp.GlobalServerConfigJSON, globalServerConfig)
221 if err != nil {
222 return fmt.Errorf("decode global server config failed: %w", err)
223 }
224
225 if globalServerConfig != nil {
226 err = globalServerConfig.Init()
227 if err != nil {
228 return fmt.Errorf("validate global server config failed: %w", err)
229 }
230 if sharedNodeConfig != nil {
231 sharedNodeConfig.GlobalServerConfig = globalServerConfig
232 }
233 }
234 }
235 return nil
236}
237
238// 单个用户服务状态变更
239func (this *Node) execUserServersStateChangedTask(rpcClient *rpc.RPCClient, task *pb.NodeTask) error {

Callers 1

execTaskMethod · 0.95

Calls 3

ContextMethod · 0.80
ErrorfMethod · 0.80
InitMethod · 0.65

Tested by

no test coverage detected