Node.js http retry do while mechanism
In terms of performance this should not be an issue, because async operations don't block the event loop, meaning your server will happily accept incoming requests in between the retries. Once in 2 seconds it will be busy making the request to the 3rd party API, but other than that your will not be blocking the main thread.

(You can verify that by shooting requests to your API while it is in the while loop).