Skip to content

Instantly share code, notes, and snippets.

@uphotelagency
Created April 23, 2020 16:24
Show Gist options
  • Save uphotelagency/5b290e5edaa6aceaf38eb17dc730a242 to your computer and use it in GitHub Desktop.
Save uphotelagency/5b290e5edaa6aceaf38eb17dc730a242 to your computer and use it in GitHub Desktop.
const result = polly().handle(error => error.status === 429)
.waitAndRetry(retryTimes).executeForPromise(async () => {
const response = await axios.get(`${apiUrl}/booking/v1/offer-index`, requestConfig);
if (response.data) {
return response.data;
}
return Promise.reject();
}
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment