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

fix: add status code 429 to bandh backOffStatusCodes #404

Merged
merged 1 commit into from
Oct 1, 2020
Merged

fix: add status code 429 to bandh backOffStatusCodes #404

merged 1 commit into from
Oct 1, 2020

Conversation

adolfox
Copy link
Contributor

@adolfox adolfox commented Oct 1, 2020

Description

processBackoffDelay only triggers with status codes 403.

I was getting a lot of RATE LIMIT EXCEEDEDs from B&H.
bandh_rate_limit_exceeded

In lookupCard, however, it does check for 429 and logs it as a warning.

if (statusCode === 429) {
			Logger.warn(Print.rateLimit(link, store, true));

I figure that getting these RATE LIMIT EXCEEDEDs is bad and it should trigger a backoff, so I added 429 to bandh.ts to the backoffStatusCodes: [403, 429] array/list.

A lot less RATE LIMIT EXCEEDEDs
bandh_rate_limit_exceeded_backoff_working

Testing

I've been running it with the added 429 and it's been running fine for the last few hours with no issues. Less RATE LIMIT EXCEEDEDs.

edit: code formatting

@adolfox adolfox requested a review from jef as a code owner October 1, 2020 16:40
Copy link
Owner

@jef jef left a comment

Choose a reason for hiding this comment

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

Great! Sounds good to me. Weird that we were getting 403s... I guess we get blocked for a certain amount of time.

Thanks for bringing this one in.

@jef jef changed the title Fix: Added status code 429 to bandh backOffStatusCodes. fix: add status code 429 to bandh backOffStatusCodes Oct 1, 2020
@jef jef merged commit 7a981e7 into jef:main Oct 1, 2020
@adolfox
Copy link
Contributor Author

adolfox commented Oct 1, 2020

Cool. Thank you for the quick review.

@adolfox adolfox deleted the bandhRateLimitExceededFix branch October 1, 2020 17:18
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.

2 participants