#arian_webhooks

1 messages ¡ Page 1 of 1 (latest)

odd estuaryBOT
#

👋 Welcome to your new thread!

⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

🔗 This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1362213560289329212

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

graceful glacier
#

Hi! Not sure what exactly you're asking here; can you fill me in?

#

Oh.

#

You just need a lock somewhere.

mint kindle
#

a lock?

graceful glacier
#

Ya, you need to make sure that only one thing can operate on that record at a time.

#

And as I type this, I realize that may not work on creation ...

mint kindle
#

would it be possible to create a map outside of the webhook handler, that stores the session ids, and if the session id is in that map, it does not proceed with fulfillment?

graceful glacier
#

What Stripe event triggers this process?

mint kindle
#

"checkout.session.completed" and "checkout.session.async_payment_succeeded"

#

Like would something like this work out (I'll fix the delete)

graceful glacier
#

You're just trying to mitigate against duplicate Stripe Events, right?

mint kindle
#

I'm not quite sure, I'm just assuming it would may get called twice concurrently. In which case, I don't want it to send an email twice, or something like that.

#

Because that's what the docs say

odd estuaryBOT
slate sky
#

I would assume that you have a queue and you process each event in the queue one by one

mint kindle
#

would that be an optimal way to approach this problem?

slate sky
#

You might want to look online for different solutions to this problem and see what works best for you. What I suggested is just one way to approach it!