Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add retry support #1293

Merged
merged 30 commits into from
Sep 8, 2023
Merged

Add retry support #1293

merged 30 commits into from
Sep 8, 2023

Conversation

HantingZhang2
Copy link
Contributor

What does this PR do?

Adds retry support for the api client

Additional Notes

Review checklist

Please check relevant items below:

  • This PR includes all newly recorded cassettes for any modified tests.

  • This PR does not rely on API client schema changes.

    • The CI should be fully passing.
  • Or, this PR relies on API schema changes and this is a Draft PR to include tests for that new functionality.

    • Note: CI shouldn't be run on this Draft PR, as its expected to fail without the corresponding schema changes.

@HantingZhang2 HantingZhang2 requested a review from a team as a code owner August 23, 2023 21:57
@HantingZhang2 HantingZhang2 marked this pull request as draft August 23, 2023 21:58
@HantingZhang2 HantingZhang2 marked this pull request as ready for review August 23, 2023 22:22
@github-actions github-actions bot added the documentation Improvements or additions to documentation label Aug 25, 2023
@therve therve changed the title Hzhang/add retry Add retry support Sep 7, 2023
Copy link
Contributor

@therve therve left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One minor comment otherwise looks good. Wondering maybe if we should remove the recursive call and use a loop like everywhere else? It seems different for no particular reason.

@HantingZhang2
Copy link
Contributor Author

One minor comment otherwise looks good. Wondering maybe if we should remove the recursive call and use a loop like everywhere else? It seems different for no particular reason.

TS does not support jump target cross function boundary which made using loop harder at the beginning.
And since the response object is generated inside the while loop, we have to create an empty response object outside of the loop before hand so syntax wise, the function can always return a response.

@HantingZhang2 HantingZhang2 merged commit 9b22d7d into master Sep 8, 2023
@HantingZhang2 HantingZhang2 deleted the hzhang/add-retry branch September 8, 2023 15:50
github-actions bot pushed a commit that referenced this pull request Sep 8, 2023
* add configs

* Implement retry and refactor fetch

* retry test + sleep mock

* pre-commit fixes

* Test sleep time

* Revert "Merge branch 'hzhang/add-retry' of github.com:DataDog/datadog-api-client-typescript into hzhang/add-retry"

This reverts commit 61c0f17, reversing
changes made to 11fc11f.

* add test for backoffbase validation

* change generator

* pre-commit fixes

* AddPropertyBack

* pre-commit fixes

* add params to constructor

* Add nock to license

* add backoff base validation

* Update Readme

* changes

* pre-commit fixes

* refactor execute request

* pre-commit fixes

* add ()

* pre-commit fixes

* simplifie

* pre-commit fixes

---------

Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
Co-authored-by: Thomas Hervé <thomas.herve@datadoghq.com> 9b22d7d
skarimo added a commit that referenced this pull request Sep 12, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
changelog/Added documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants