[refs #3055] increase number of retries before mark-trusted-peer call
This commit is contained in:
parent
52cc220f21
commit
ddb15863f1
|
@ -227,8 +227,12 @@
|
||||||
::fetch-peers
|
::fetch-peers
|
||||||
(fn [{:keys [wnode web3 retries]}]
|
(fn [{:keys [wnode web3 retries]}]
|
||||||
;; Run immediately on first run, add delay before retry
|
;; Run immediately on first run, add delay before retry
|
||||||
(let [delay (if (zero? retries) 0 300)]
|
(let [delay (cond
|
||||||
(if (> retries 3)
|
(zero? retries) 0
|
||||||
|
(< retries 3) 300
|
||||||
|
(< retries 10) 1000
|
||||||
|
:else 5000)]
|
||||||
|
(if (> retries 100)
|
||||||
(log/error "Number of retries for fetching peers exceed" wnode)
|
(log/error "Number of retries for fetching peers exceed" wnode)
|
||||||
(js/setTimeout
|
(js/setTimeout
|
||||||
(fn [] (inbox/fetch-peers #(re-frame/dispatch [::fetch-peers-success web3 % retries])
|
(fn [] (inbox/fetch-peers #(re-frame/dispatch [::fetch-peers-success web3 % retries])
|
||||||
|
|
Loading…
Reference in New Issue