From 3879baab41f1456bb73641052d21bf686532491f Mon Sep 17 00:00:00 2001 From: Tom Beynon Date: Mon, 13 Jan 2025 13:11:08 +0000 Subject: [PATCH] Always retry requests other than broadcast --- src/utils/RestClient.mjs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils/RestClient.mjs b/src/utils/RestClient.mjs index 4159db0..9627bc3 100644 --- a/src/utils/RestClient.mjs +++ b/src/utils/RestClient.mjs @@ -14,7 +14,7 @@ const RestClient = async (chainId, restUrls, opts) => { }, opts) const restUrl = await findAvailableUrl(restUrls, { timeout: 10000 }) const client = axios.create({ baseURL: restUrl, timeout: config.timeout }); - axiosRetry(client, { retries: config.retries, shouldResetTimeout: true }); + axiosRetry(client, { retries: config.retries, shouldResetTimeout: true, retryCondition: () => true }); function getAllValidators(pageSize, opts, pageCallback) { return getAllPages((nextKey) => { @@ -285,7 +285,7 @@ const RestClient = async (chainId, restUrls, opts) => { } function broadcast(params){ - return client.post(apiPath('tx', `txs`), params, { timeout: 30000 }) + return client.post(apiPath('tx', `txs`), params, { timeout: 30000, 'axios-retry': { retries: 0 } }) .then((res) => parseTxResult(res.data.tx_response)) }