MCPcopy Index your code
hub / github.com/CovenantSQL/CovenantSQL / nonBlockingSync

Method nonBlockingSync

cmd/cqld/adapter.go:237–259  ·  view source on GitHub ↗
(node *proto.Node, origin proto.NodeID, ttl uint32)

Source from the content-addressed store, hash-verified

235}
236
237func (s *KVServer) nonBlockingSync(node *proto.Node, origin proto.NodeID, ttl uint32) {
238 if s.peers == nil {
239 return
240 }
241
242 c, cancel := context.WithTimeout(s.ctx, s.timeout)
243 defer cancel()
244 for _, n := range s.peers.Servers {
245 if n != s.current && n != origin {
246 // sync
247 req := &GossipRequest{
248 Node: node,
249 TTL: ttl,
250 }
251
252 s.wg.Add(1)
253 go func(node proto.NodeID) {
254 defer s.wg.Done()
255 _ = rpc.NewCaller().CallNodeWithContext(c, node, route.DHTGSetNode.String(), req, nil)
256 }(n)
257 }
258 }
259}

Callers 1

SetNodeExMethod · 0.95

Calls 3

CallNodeWithContextMethod · 0.80
AddMethod · 0.45
StringMethod · 0.45

Tested by

no test coverage detected