(node *proto.Node, origin proto.NodeID, ttl uint32)
| 235 | } |
| 236 | |
| 237 | func (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 | } |
no test coverage detected