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

Method Loop

internal/monitor/value_queue.go:70–92  ·  view source on GitHub ↗

Loop 单次循环

()

Source from the content-addressed store, hash-verified

68
69// Loop 单次循环
70func (this *ValueQueue) Loop() error {
71 rpcClient, err := rpc.SharedRPC()
72 if err != nil {
73 return err
74 }
75
76 for value := range this.valuesChan {
77 _, err = rpcClient.NodeValueRPC.CreateNodeValue(rpcClient.Context(), &pb.CreateNodeValueRequest{
78 Item: value.Item,
79 ValueJSON: value.ValueJSON,
80 CreatedAt: value.CreatedAt,
81 })
82 if err != nil {
83 if rpc.IsConnError(err) {
84 remotelogs.Warn("MONITOR", err.Error())
85 } else {
86 remotelogs.Error("MONITOR", err.Error())
87 }
88 continue
89 }
90 }
91 return nil
92}

Callers 1

StartMethod · 0.95

Calls 6

SharedRPCFunction · 0.92
IsConnErrorFunction · 0.92
WarnFunction · 0.92
ErrorFunction · 0.92
ContextMethod · 0.80
ErrorMethod · 0.45

Tested by

no test coverage detected