If you are using Python Shopify API
and getting following error
"Exceeded 4 calls per second for api client. Reduce request rates to resume uninterrupted service."
but want your script to continue working with some timeout after that,
you can use following script from shopify_limits_patch.py
.
For that just copy shopify_limits_patch.py
to your project and import shopify_limits_patch
.
Or if you want to call it implicitly import it, remove last line patch_shopify_with_limits()
and call it before all your shopify calls.
This is solution for issue described here: Shopify/shopify_python_api#256
If you have any suggestions for code - leave comment :)
Is there a way to do the same thing in requests library. I am using python requests to POST data to shopify (add new image) endpoint.
where, the above code is getting called inside a for loop.
Once i hit the shopify benchmark for requests (40 per bucket) . it throws a error saying "Exceeded 2 calls per second for api client" and everything crashes.
Is there anything that can be done over here ?
i tried by putting sleep(3) seconds for every image being create inside the loop. it works . but don't think this is scalable enough and fast.
Any help would be highly appreaciated.