openethereum/js-libs

isParityRunning takes 7 seconds to complete

Closed this issue · 0 comments

https://github.com/paritytech/js-libs/blob/master/packages/electron/src/runParity.ts

When we launch Fether, we check if Parity is running by calling isParityRunning, which tries to connect to various hosts. However, if the hosts are down (i.e. if Parity is not running), then the function takes a while to complete (delaying the launch of Parity by 7 seconds in my case) because each request hangs for quite a while

We could:

  • run the requests parallelly, or remove the hard-coded attempts to connect to http://127.0.0.1:8545 and http://127.0.0.1:8546
  • automatically time out if there was no succesful connexion after, say, 1s

The axios timeout setting does not seem to have an effect if the server cannot be reached