Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

feat: Add configurable update rate #116

Merged
merged 10 commits into from
Jan 30, 2023

Conversation

vililahtevanoja
Copy link
Contributor

Issue #, if available: #76

Description of changes:

  • Add configurable update interval and back-off time. Slight refactoring was required in order to transfer the values from the GitHub inputs to where they are used. SDK-specific configuration parameters and general action configuration values (currently just the update rate configuration) are treated slightly differently and are passed as separate objects to the building and waiting functions.
  • Add new test for handling the update rate configuration
  • Update existing tests where needed
  • Add new inputs to action metadata file
  • Update README.md

Default values are kept the same (30s interval, 15s back-off), so there should be no breakage when updating.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Check any applicable:

  • Were any files moved? Moving files changes their URL, which breaks all hyperlinks to the files.

Supercedes #77 (which can be closed).

code-build.js Outdated
@@ -87,16 +90,17 @@ async function waitForBuildEndTime(
//We caught an error in trying to make the AWS api call, and are now checking to see if it was just a rate limiting error
if (errObject.message && errObject.message.search("Rate exceeded") !== -1) {
//We were rate-limited, so add `backOff` seconds to the wait time
let newWait = wait + backOff;
let newWait = updateInterval + updateBackOff;
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Applied Full Jitter to the added backoff now. If/when the backoff implementation looks good, I also need to update the backoff description in relevant places.

@taoyong-ty
Copy link
Contributor

The action run failed, possibly caused by a recent version bump in pull/115

Could you please rebase the PR again? Thank you

test/code-build-test.js Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants