diff --git a/scripts/exports/export-error-rpc.js b/scripts/exports/export-error-rpc.js index b3275682..de630a21 100755 --- a/scripts/exports/export-error-rpc.js +++ b/scripts/exports/export-error-rpc.js @@ -37,7 +37,7 @@ const isValidUrl = (url) => { } } -const checkHealthEvmRpc = async (url) => { +const _checkHealthEvmRpc = async (url) => { try { const web3 = new Web3(url) await web3.eth.getBlockNumber() @@ -49,6 +49,17 @@ const checkHealthEvmRpc = async (url) => { } } +const checkHealthEvmRpc = async (url, count = 0) => { + + let status = await _checkHealthEvmRpc(url) + if(++count < 3 && status === STATUS.INACTIVE){ + await new Promise(resolve => setTimeout(resolve, 1000)); + status = await checkHealthEvmRpc(url, count) + } + + return status +} + const checkHealthSubstrateRpc = async (url) => { try { let provider @@ -164,7 +175,6 @@ setImmediate(async () => { try { await checkHealthRpc() - process.exit() } catch (err) {