#Reformedot

1 messages · Page 1 of 1 (latest)

acoustic gardenBOT
frosty zealot
#

Hi!

#

This object cannot be accessed right now because another API request or Stripe process is currently accessing it. If you see this error intermittently, retry the request. If you see this error frequently and are making multiple concurrent requests to a single object, make your requests serially or at a lower rate.

dusk fulcrum
frosty zealot
#

This is the error while fetching the customers when we retry

#

req_LBfYFPmResqsg9

#

My plan is to add a delay between retries, but I'm worried about raising a timeout error, can't find the max amout of time of our response to the stripe webhook

#

Any idea?

dusk fulcrum
#

Could you share what you are trying to achieve by fetching the customer and why would you retry immediately after receiving a failed payment?

frosty zealot
#

our handle_payment_failed fetches the customer, we grab the available payment methods inside that customer, and we retry the same invoice switching payments

#

when we retry, the invoice can fail again, and that raises a new webhook, that we handle. But the fetch customer, raises a 429 cause we don't have a delay between retries

#

My question is: Which delay should I use? I don't want to timeout the webhook request

dusk fulcrum
#

We don't have a recommended delay duration as processing time on the same customer varies. In general, I'd recommend returning 2xx response to Stripe first, then process retry asynchronously to avoid timeout on the webhook request.

frosty zealot
#

Okay thanks

dusk fulcrum
#

No problem! Happy to help 😄

frosty zealot
#

What happens if a webhook timesout?

dusk fulcrum
#

If your webhook doesn't respond in time, Stripe will attempt to deliver re-events:

If your webhook server doesn't respond 2xx multiple days in a row, the webhook endpoint will be disabled automatically.

frosty zealot
#

Okay thanks river!

dusk fulcrum
#

No problem 👍

frosty zealot
#

There's a way to know the max timeout?

#

to make sure that we don't raise it

dusk fulcrum
#

I'm afraid max timeout is not provided. We always recommend to respond 2xx status to Stripe first before processing your internal logic in webhook handler

frosty zealot
#

Okay river, thanks for your patience

#

That's all, have a good day!

dusk fulcrum
#

No problem! Have a good day to you as well 🙂

frosty zealot
#

❤️