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

Add support for default max tries setting for Http requests #282

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ugurarici
Copy link

@ugurarici ugurarici commented Jun 17, 2023

WHY are these changes introduced?

Fixes #281

Shopify\Clients\Http is able to retry a request if response code is retriable and tries parameter given to request method. This change gives ability to set a default max tries count for each Http request unless overridden by request method parameter. This way we can also use retries with REST resources.

WHAT is this pull request doing?

Adds a $maxTries parameter to Shopify\Context::initialize method with a default value of 1. Assigns it to Shopify\Context::$MAX_TRIES and uses it as default value in request method of Shopify\Client\Http.

Type of change

  • Patch: Bug (non-breaking change which fixes an issue)
  • Minor: New feature (non-breaking change which adds functionality)
  • Major: Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist

  • I have added a changelog entry, prefixed by the type of change noted above
  • I have added/updated tests for this change
  • I have updated the documentation

@ugurarici
Copy link
Author

I have signed the CLA!

@lukeholder
Copy link

Fixes #203 and Fixes #281

@paulomarg who is the best person to review things like this?

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.

Ability to assign a default value to $maxTries in REST requests
2 participants