-
Notifications
You must be signed in to change notification settings - Fork 188
Open
Labels
good first issueGood for newcomersGood for newcomers
Description
Overview/summary
Currently the abstract API calls will not handle rate limiting because $tries is not passed on here:
shopify-api-php/src/Rest/Base.php
Lines 173 to 186 in 582252e
| switch ($httpMethod) { | |
| case "get": | |
| $response = $client->get($path, [], $params); | |
| break; | |
| case "post": | |
| $response = $client->post($path, $body, [], $params); | |
| break; | |
| case "put": | |
| $response = $client->put($path, $body, [], $params); | |
| break; | |
| case "delete": | |
| $response = $client->delete($path, [], $params); | |
| break; | |
| } |
Thus $maxTries will default to 1:
shopify-api-php/src/Clients/Http.php
Line 150 in 582252e
| $maxTries = $tries ?? 1; |
Motivation
We ran into rate limiting issues that weren't handled by the library.
Possible solution
In Base.php it should take apart the $params array and take out a tries value from there, to pass it on to the appropriate function. Another solution would be to simply add an optional parameter up the chain, but that would involve changing every function in this library.
Checklist
- I have described this enhancement in a way that is actionable (if possible)
Lemondragon, rafaelstz, layerok, elburro1887, lukeholder and 1 more
Metadata
Metadata
Assignees
Labels
good first issueGood for newcomersGood for newcomers