From ddb15863f19491f419ac7093b37205f0192f2d6a Mon Sep 17 00:00:00 2001 From: Dmitry Novotochinov Date: Wed, 7 Feb 2018 19:38:04 +0300 Subject: [PATCH] [refs #3055] increase number of retries before mark-trusted-peer call --- src/status_im/protocol/handlers.cljs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/status_im/protocol/handlers.cljs b/src/status_im/protocol/handlers.cljs index 1ff0e81277..bbff383ee5 100644 --- a/src/status_im/protocol/handlers.cljs +++ b/src/status_im/protocol/handlers.cljs @@ -227,8 +227,12 @@ ::fetch-peers (fn [{:keys [wnode web3 retries]}] ;; Run immediately on first run, add delay before retry - (let [delay (if (zero? retries) 0 300)] - (if (> retries 3) + (let [delay (cond + (zero? retries) 0 + (< retries 3) 300 + (< retries 10) 1000 + :else 5000)] + (if (> retries 100) (log/error "Number of retries for fetching peers exceed" wnode) (js/setTimeout (fn [] (inbox/fetch-peers #(re-frame/dispatch [::fetch-peers-success web3 % retries])