Skip to content
This repository was archived by the owner on Oct 6, 2026. It is now read-only.

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

Closed
ugurarici wants to merge 2 commits into
Shopify:mainfrom
ugurarici:add_default_max_tries
Closed

ugurarici wants to merge 2 commits into
Shopify:mainfrom
ugurarici:add_default_max_tries

Conversation

@ugurarici

@ugurarici ugurarici commented Jun 17, 2023 •

Copy link
Copy Markdown

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
Copy Markdown
Author

I have signed the CLA!

@lukeholder

Copy link
Copy Markdown

Fixes #203 and Fixes #281

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

@Suleimanlatrsh

Copy link
Copy Markdown
Contributor

Thanks for contributing! This package is deprecated and we're archiving this repo, so we're closing all open issues and PRs. Please use shopify-app-php instead, and open new issues there. More context: Rethinking support for PHP/Python packages

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

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

3 participants