-
Notifications
You must be signed in to change notification settings - Fork 253
Open
Description
go-libp2p-kad-dht/provider/provider.go
Lines 1992 to 2004 in 0d37d0b
| if reprovideAll { | |
| // If the keystore is resettable, RefreshSchedule should be called after a | |
| // Keystore.Reset(), to reflect recent changes on the schedule. | |
| // If the schedule is not empty, and its size is about to double, it means | |
| // that many new keys were added to the Keystore recently, and we want to | |
| // reprovide all regions as soon as possible to make sure the provider | |
| // records are available in the DHT. | |
| // This is a corner case that is required for Kubo, as Keystore.Reset() | |
| // takes a while. | |
| for _, entry := range keyspace.AllEntries(s.schedule, s.order) { | |
| s.reprovideQueue.Enqueue(entry.Key) | |
| } | |
| } |
If using a ResettableKeystore, we should only reprovide the regions that were reprovided since the node started. The regions that have been reprovided in a previous run, but less than ReprovideInterval ago don't need to be reprovided.
Metadata
Metadata
Assignees
Labels
No labels