MCPcopy
hub / github.com/olric-data/olric / fetchRoutingTablePeriodically

Method fetchRoutingTablePeriodically

cluster_iterator.go:267–280  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

265}
266
267func (i *ClusterIterator) fetchRoutingTablePeriodically() {
268 defer i.wg.Done()
269
270 for {
271 select {
272 case <-i.ctx.Done():
273 return
274 case <-time.After(time.Second):
275 if err := i.fetchRoutingTable(); err != nil {
276 i.logger.Printf("[ERROR] Failed to fetch the latest version of the routing table: %s", err)
277 }
278 }
279 }
280}
281
282func (i *ClusterIterator) fetchRoutingTable() error {
283 routingTable, err := i.clusterClient.RoutingTable(i.ctx)

Callers 1

ScanMethod · 0.95

Calls 2

fetchRoutingTableMethod · 0.95
PrintfMethod · 0.80

Tested by

no test coverage detected