Add multiple items issue with API

Hi,

When trying to add multiple items at the same time, I’m getting the following error:
“Could not acquire exclusive access to resource within the allowed time span. You may repeat this request at a later time.”

Why is this happening and how to solve it? I’m attaching screenshots of the network response and payload.

See the payload below:

availablePlans: null
customFields: [{name: "Color",…}]
0: {name: "Color",…}
name: "Color"
options: "Default|Bright White[+80.00]|Graphite Black[+80.00]|Combat Grey[+80.00]|Stone Grey[+80.00]|Sniper Grey[+80.00]|Saten Aluminum[+80.00]|Tungsten[+80.00]|Burnt Bronze[+80.00]|Chocolate Brown[+80.00]|Coyote Tan[+80.00]|Desert Sand[+80.00]|Flat Dark Earth[+80.00]|O.D. Green[+80.00]|Multicam Light Green[+80.00]|Noveske Green[+80.00]|Zombie Green[+80.00]|Kel-Tec Navy Blue[+80.00]|NRA Blue[+80.00]|Robin's egg blue[+80.00]|Firehouse Red[+80.00]|Prison Pink[+80.00]|Rose Gold[+80.00]|Gold[+80.00]|Bright Purple[+80.00]|Custom Color[+100.00]"
value: "Default"
id: "cG9zdDoxMDA="
image: "http://localhost:8000/static/d6d8f73626d01330167bb381519262be/49c0b/Bitmap-1%402x-4.png"
name: "Holosun 507k – x2"
price: 289.99
quantity: 1
stackable: true
url: "/products/holosun-507k-x2/"

Thanks in advance for your help.

Hi @Rick, thanks for reaching out.

I believe we are discussing this with you over email. For future reference, this could be caused by hitting our rate limits or payload limits.

Thanks!

Hi @nelitow. Thanks for your response. I really get slow responses via email, could you give me a solution for this? I’m trying to add around 20 items at the same time, the workaround I found is adding a timeout of 1 sec, but is definitely not ideal.

Hi @rick.

The issue is that we lock the resource for each item. The solution at the moment is to wait for each call to be completed before calling the next one. While is it still not ideal, if you are able to listen to the return of the request and make the next call right away it should take much less than the current 20 seconds.

If there is anything else we can help with, please let us know.

Thanks.