Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

[INTERNAL] Update retry mechanics #10

Draft
wants to merge 7 commits into
base: dm/feature/support-skipped-builds
Choose a base branch
from

Conversation

elskwid
Copy link

@elskwid elskwid commented Feb 13, 2022

TODO

  • Test this version in lighthouse workflow
  • Update PR description
  • Remove dist build from PR (temp commit)

Don Morrison added 7 commits February 12, 2022 17:03
Refactors the internals of `waitForDeployCreation` to use p-retry. The
p-retry library:

* Has a more straightforward API than `setInterval`/`setTimer`
* Uses exponential backoff for the retry semantics
* Allows for further refinement of the operations
* Makes the first request immediately which can shorten run times when
  the resource is already available.

Refer to:
  * https://github.com/sindresorhus/p-retry
  * https://github.com/tim-kos/node-retry
Refactors the internals of `waitForReadiness` to use p-retry. The
p-retry library:

* Has a more straightforward API than `setInterval`/`setTimer`
* Uses exponential backoff for the retry semantics
* Allows for further refinement of the operations
* Makes the first request immediately which can shorten run times when
  the resource is already available.

Refer to:
  * https://github.com/sindresorhus/p-retry
  * https://github.com/tim-kos/node-retry
Refactors the internals of `waitForUrl` to use p-retry. The
p-retry library:

* Has a more straightforward API than `setInterval`/`setTimer`
* Uses exponential backoff for the retry semantics
* Allows for further refinement of the operations
* Makes the first request immediately which can shorten run times when
  the resource is already available.

The tests have been updated to more accurately reflect how Axios
behaves in certain circumstances - errors for non-200 response.

Refer to:
  * https://github.com/sindresorhus/p-retry
  * https://github.com/tim-kos/node-retry
Now that the wait* functions are using `p-retry` the short timeouts
are not needed in the test workflow because the initial request is
performed immediately.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant