提交 867186c0 作者: Jeromy

dont create a new ticker each loop

上级 cc5f6bb3
......@@ -182,10 +182,11 @@ func (bs *Bitswap) rebroadcastWorker(parent context.Context) {
defer cancel()
broadcastSignal := time.After(rebroadcastDelay.Get())
tick := time.Tick(10 * time.Second)
for {
select {
case <-time.Tick(10 * time.Second):
case <-tick:
n := bs.wantlist.Len()
if n > 0 {
log.Debug(n, inflect.FromNumber("keys", n), "in bitswap wantlist")
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论