@cryptotaxi247 / kubo / commits / 228c5552a

always obey the IPNS rebroadcast interval if it's smaller

License: MIT Signed-off-by: Steven Allen <steven@stebalien.com>

Steven Allen committed Nov 29, 2017 at 15:54 UTC 228c5552ab7b14875692a52aa97a01becec4771b
1 file changed +6 -1
namesys/republisher/repub.go
+6 -1
@@ -65,6 +65,9 @@ func NewRepublisher(r routing.ValueStore, ds ds.Datastore, self ic.PrivKey, ks k
65 func (rp *Republisher) Run(proc goprocess.Process) {
66 timer := time.NewTimer(InitialRebroadcastDelay)
67 defer timer.Stop()
68 + if rp.Interval < InitialRebroadcastDelay {
69 + timer.Reset(rp.Interval)
70 + }
71
72 for {
73 select {
@@ -73,7 +76,9 @@ func (rp *Republisher) Run(proc goprocess.Process) {
76 err := rp.republishEntries(proc)
77 if err != nil {
78 log.Error("Republisher failed to republish: ", err)
76 - timer.Reset(FailureRetryInterval)
79 + if FailureRetryInterval < rp.Interval {
80 + timer.Reset(FailureRetryInterval)
81 + }
82 }
83 case <-proc.Closing():
84 return