Skip to content

Commit

Permalink
fix(dht): try to not make blocking announces
Browse files Browse the repository at this point in the history
Signed-off-by: Ettore Di Giacinto <[email protected]>
  • Loading branch information
mudler authored Aug 21, 2024
1 parent e4cfa69 commit b25762b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/discovery/dht.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,13 +117,13 @@ func (d *DHT) Run(c log.StandardLogger, ctx context.Context, host host.Host) err
}

go func() {
connect()
go connect()
t := utils.NewBackoffTicker(utils.BackoffMaxInterval(d.RefreshDiscoveryTime))
defer t.Stop()
for {
select {
case <-t.C:
connect()
go connect()
case <-ctx.Done():
return
}
Expand Down

0 comments on commit b25762b

Please sign in to comment.