[refs #3055] increase number of retries before mark-trusted-peer call

This commit is contained in:
Dmitry Novotochinov 2018-02-07 19:38:04 +03:00 committed by Eric Dvorsak
parent 52cc220f21
commit ddb15863f1
No known key found for this signature in database
GPG Key ID: 932AC1CE5F05DE0C
1 changed files with 6 additions and 2 deletions

View File

@ -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])