Thanks for the article. I was looking for an article which can handle huge number of api calls to maps.google.com autocomplete api, I am glad that I found this article, very well written with step by step performance optimisation.
But even though I am using the above pattern I am getting getaddrinfo enotfound error. I am making a huge number of api calls to maps.google.com api.
So can you suggest me a way in the above pattern to make a retry request for the failed requests?
Also is there a github repo for the above code?
Great question!
Handling errors heavily depends on your particular use case. At least I can think of three ways:
just skip the rejected promise and move on
have a predefined amount of attempts before move on
keep trying to fetch a request until success
Here's the simplified example for the 3rd option. I use series helper for simplicity. Fake API request may fail. We keep trying to request API until success.
Thanks for the article. I was looking for an article which can handle huge number of api calls to maps.google.com autocomplete api, I am glad that I found this article, very well written with step by step performance optimisation.
But even though I am using the above pattern I am getting getaddrinfo enotfound error. I am making a huge number of api calls to maps.google.com api.
So can you suggest me a way in the above pattern to make a retry request for the failed requests?
Also is there a github repo for the above code?
Great question!
Handling errors heavily depends on your particular use case. At least I can think of three ways:
Here's the simplified example for the 3rd option. I use
series
helper for simplicity. Fake API request may fail. We keep trying to request API until success.And the result is