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

Use Spot Pagination API #449

Merged
merged 2 commits into from
Apr 24, 2020
Merged

Conversation

bwagner5
Copy link
Contributor

The spot API is unbounded if MaxResults is not specified which can cause long waits and possible connection timeouts if an account has a lot of spot instances. This commit specifies the MaxResults parameter to the spot-describe-instances-request API to trigger the pagination response and wraps the code in a pagination do-while loop.

I tested this on a clean jenkins install with 105 spot instances. The response properly paged through the additional 5 instances in the second page of results.

@res0nance res0nance added the enhancement Feature additions or enhancements label Apr 18, 2020
@res0nance
Copy link
Contributor

Could you add a test to this?

@bwagner5
Copy link
Contributor Author

I've tested my change locally and everything works. Can you show me an example of an existing test so I can model mine similarly?

@bwagner5
Copy link
Contributor Author

added a unit test.

Copy link
Member

@jvz jvz left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for the PR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Feature additions or enhancements
Projects
None yet
4 participants