MONEI / Shopify-api-node

Node Shopify connector sponsored by MONEI
https://monei.com/shopify-payment-gateway/
MIT License
940 stars 279 forks source link

Feature Request: autoLimit + maxRetries #590

Closed ikudosi closed 1 year ago

ikudosi commented 1 year ago

Hello,

Is it possible to have both options working? It would be great to have both options working instead of having to build logic everywhere on dev side to handle API nuances like end point temporarily unreachable. For now I am just enclosing all processes in a queue job that retries on failure (on my case I sometimes get failures from end point being momentarily unreachable). However, it would be easier if this package does both rate limit and retries given on an amount so that I don't have to start over big processes like updating 10K+ products.

lpinca commented 1 year ago

No, because the options use two completely different strategies that do not mix together. The goal of autoLimit is to never get a 429 error and to never retry. The goal of maxRetries is to retry a number of times after getting a 429 error.

ikudosi commented 1 year ago

That I understand and the auto limit works wonders, though if it's 5xx status codes, would it make sense to allow certain number of retries to account for intermittent outages? I believe it would simplify alot of development challenges when doing scheduled bulk operations.