Comments (6)
@kneeki The rate limiting is not for (your code), its the rate limiting support for Shopify API calls.
The package implements a very simple version of this, you're allowed to hit Shopify's API twice in one second for regular shops, or four times in one second for Plus shops.
Whats the limiter does, is it checks the header returned by Shopify. The header contains how many calls you used and have left. If you run out of calls, the library will sleep until it can gain calls back.
Does that help?
from basic-shopify-api.
from basic-shopify-api.
It calculates a wait time and sleeps.
from basic-shopify-api.
Hey,
Two quick questions regarding the conversation in this issue:
-
You mention the limiter checks the header returned by Shopify, but in the code it seems it just keeps the timestamp of the last request it issued, and calculate the sleep time based on that, so not real check based on the Shopify header - am I missing something?
-
If I didn't miss anything, that means the limiter only "knows" about recent requests made by itself, so in the case of the OP, when the requests are made by separate jobs, the limiter will not know about the other requests - am I right or wrong?
Of course if I'm wrong in question #1 and the limiter does check the header by Shopify, it will support rate limiting requests from separate jobs, so I hope I am wrong :-)
Thanks!
Amos
from basic-shopify-api.
from basic-shopify-api.
Thanks!
It makes perfect sense.
So would you recommend to check if a request had a rate limit issue and in that case use the getApiCalls function to check when run it again?
I can assume this function can be the basis for an internal mechanism that will automatically run the call again until a different response is sent (I think there's a different issue for that which you said you might work on in the future).
Also, I'm not an expert on static values so correct me if I'm wrong, but I believe that won't help in case of async queue jobs calling the api.
THANKS!
Amos
from basic-shopify-api.
Related Issues (20)
- REST API Rate Limit Issues - handleRest() function - AWS Lambda HOT 4
- RateLimiter blowing up after change HOT 6
- Inconsistent Error Handling in use of Body in Response HOT 1
- Unable to set header on graphQL for Retrieving Storefront API translations HOT 1
- It would be useful to be able to change the graphql endpoint URL
- Custom Store Implementations HOT 1
- Problem with GraphQL and multiple mutations HOT 1
- getSession
- PHP 8.1 Warnings HOT 1
- Object of type Osiset\BasicShopifyAPI\BasicShopifyAPI is not callable
- cURL Timeout HOT 1
- v10.0.6 throws errors in PHP 7.4 HOT 2
- Return value of Osiset\BasicShopifyAPI\ResponseAccess::offsetGet() must be an instance of Osiset\BasicShopifyAPI\mixed, string returned HOT 3
- Resource Route not working HOT 1
- Sessions don't have a session ID HOT 1
- How to update webhook URL's for old stores? HOT 1
- Rest api upload image HOT 1
- Call to undefined function env() HOT 6
- Query is not working
- not finding classes
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from basic-shopify-api.