mirror of
https://github.com/ipfs/kubo.git
synced 2025-07-02 03:28:25 +08:00
always obey the IPNS rebroadcast interval if it's smaller
License: MIT Signed-off-by: Steven Allen <steven@stebalien.com>
This commit is contained in:
@ -65,6 +65,9 @@ func NewRepublisher(r routing.ValueStore, ds ds.Datastore, self ic.PrivKey, ks k
|
|||||||
func (rp *Republisher) Run(proc goprocess.Process) {
|
func (rp *Republisher) Run(proc goprocess.Process) {
|
||||||
timer := time.NewTimer(InitialRebroadcastDelay)
|
timer := time.NewTimer(InitialRebroadcastDelay)
|
||||||
defer timer.Stop()
|
defer timer.Stop()
|
||||||
|
if rp.Interval < InitialRebroadcastDelay {
|
||||||
|
timer.Reset(rp.Interval)
|
||||||
|
}
|
||||||
|
|
||||||
for {
|
for {
|
||||||
select {
|
select {
|
||||||
@ -73,7 +76,9 @@ func (rp *Republisher) Run(proc goprocess.Process) {
|
|||||||
err := rp.republishEntries(proc)
|
err := rp.republishEntries(proc)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Error("Republisher failed to republish: ", err)
|
log.Error("Republisher failed to republish: ", err)
|
||||||
timer.Reset(FailureRetryInterval)
|
if FailureRetryInterval < rp.Interval {
|
||||||
|
timer.Reset(FailureRetryInterval)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
case <-proc.Closing():
|
case <-proc.Closing():
|
||||||
return
|
return
|
||||||
|
Reference in New Issue
Block a user