Commit b8eb083e authored by Steven Allen's avatar Steven Allen

chore(bootstrap): rename scanInterval to refreshTicker

parent 76f388b6
...@@ -45,20 +45,20 @@ func (dht *IpfsDHT) startRefreshing() error { ...@@ -45,20 +45,20 @@ func (dht *IpfsDHT) startRefreshing() error {
dht.proc.Go(func(proc process.Process) { dht.proc.Go(func(proc process.Process) {
ctx := processctx.OnClosingContext(proc) ctx := processctx.OnClosingContext(proc)
scanInterval := time.NewTicker(dht.rtRefreshPeriod) refreshTicker := time.NewTicker(dht.rtRefreshPeriod)
defer scanInterval.Stop() defer refreshTicker.Stop()
// refresh if option is set // refresh if option is set
if dht.autoRefresh { if dht.autoRefresh {
dht.doRefresh(ctx) dht.doRefresh(ctx)
} else { } else {
// disable the "auto-refresh" ticker so that no more ticks are sent to this channel // disable the "auto-refresh" ticker so that no more ticks are sent to this channel
scanInterval.Stop() refreshTicker.Stop()
} }
for { for {
select { select {
case <-scanInterval.C: case <-refreshTicker.C:
case <-dht.triggerRtRefresh: case <-dht.triggerRtRefresh:
logger.Infof("triggering a refresh: RT has %d peers", dht.routingTable.Size()) logger.Infof("triggering a refresh: RT has %d peers", dht.routingTable.Size())
case <-ctx.Done(): case <-ctx.Done():
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment