Skip to content

adds support to recognize request limit error to the error plugin #30

Merged
timkolm merged 2 commits intostarweb:feature/readonly-properties-supportfrom
lordrhodos:feature/handle-api-limit
Sep 25, 2020
Merged

adds support to recognize request limit error to the error plugin #30
timkolm merged 2 commits intostarweb:feature/readonly-properties-supportfrom
lordrhodos:feature/handle-api-limit

Conversation

@lordrhodos
Copy link
Contributor

@lordrhodos lordrhodos commented Sep 25, 2020

https://favro.com/organization/d98323ed4cfac48a92f11bf7/ce2fdb286ec7331714f87def?card=Sta-11929

Adds support to recognize max request errors from the SWS Shop API which will be returned if we send more than 1000 request per minute. Solve this by sleeping in incremental steps of five seconds before resending the request

… sleep in incremental steps until the limit is released again
Copy link
Member

@timkolm timkolm left a comment

Choose a reason for hiding this comment

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

Good change!
One small naming suggestion

*/
final class ErrorPlugin implements Plugin
{
private const SECONDS_TO_SLEEP_ON_MAX_REQUEST_PER_LIMIT_ERROR = 5;
Copy link
Member

Choose a reason for hiding this comment

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

maybe it should be SECONDS_TO_SLEEP_ON_MAX_REQUEST_PER_MINUTE_ERROR ?

@lordrhodos lordrhodos requested a review from timkolm September 25, 2020 13:23
Copy link
Member

@timkolm timkolm left a comment

Choose a reason for hiding this comment

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

Good job!

@timkolm timkolm merged commit 4839583 into starweb:feature/readonly-properties-support Sep 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments