Skip to content

Commit d0da9fb

Browse files
authored
fix: faster kademlia startup (ethersphere#2130)
1 parent 6d4c8ba commit d0da9fb

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pkg/topology/kademlia/kademlia.go

+5-1
Original file line numberDiff line numberDiff line change
@@ -505,7 +505,7 @@ func (k *Kad) manage() {
505505
select {
506506
case <-k.quit:
507507
return
508-
case <-time.After(30 * time.Second):
508+
case <-time.After(15 * time.Second):
509509
start := time.Now()
510510
if err := k.collector.Flush(); err != nil {
511511
k.metrics.InternalMetricsFlushTotalErrors.Inc()
@@ -588,6 +588,10 @@ func (k *Kad) Start(_ context.Context) error {
588588
k.metrics.StartAddAddressBookOverlaysTime.Observe(float64(time.Since(start).Nanoseconds()))
589589
}()
590590

591+
// trigger the first manage loop immediately so that
592+
// we can start connecting to the bootnode quickly
593+
k.notifyManageLoop()
594+
591595
return nil
592596
}
593597

0 commit comments

Comments
 (0)