Closed resistorsoftware closed 1 year ago
When making thousands of API calls you inevitably will hit Shopify 5XX or connection errors. You could handle it using Ruby rescue
, sleep
, and retry
. Or extract calls to ActiveJob so it will retry it for you.
My point was, having to babysit the GQL by writing in a rescue retry for every single API call is perhaps the worst of the good options, and maybe this could be built-in to this module as some kind of configurable thing. If you don't want it here, then monkey-patching and unique individual customization is 100% possible, but less than desirable for general use!
SignalException ---> SignalException: SIGTERM
So this is tricky! Ruby deals with this via HTTParty which then extends to ShopifyAPI before finally dying on the hill of my task and Shopify GraphQL and rake.
Even wrapping a SignalException rescue does not save the day. Straight up, due to some kind of serious bad news bears, the concept of looping and doing API calls dies badly. Yay!
I am using this library to create 1000 products. It often blows out on either the product create or publish call.
A sample error stream would be on the request itself, with this:
So I would like to have this call simply wait say 5 seconds, then retry itself. I am interested in how to best code that up.
My sample calling code is straight out of the docs and blows out on line one of the call method.