#chafem - Webhooks

1 messages · Page 1 of 1 (latest)

glossy dagger
#

There's no specific set timeout number but usually 5-10s

dark walrus
#

Alright, so I just ran 3 webhooks that took 15 seconds each and they were all successful, is there anything that determines how long the webhook will wait? (amount of calls made, load on server at the time, etc)

#

15 second is an extreme example, but we are at the mercy of another 3rd party API we need to incorporate in our processing thats includes in the processing on our endpoint, sometimes that API can take 5-6 seconds to finish doing its job, so I wanted to make sure we werent going to run into any issues from the webhook timing out in those cases

glossy dagger
#

There are "reasons" but they vary which is why we don't specify an exact threshold.

#

As for the process of your API, could you return an async success response while doing the work?

olive rampart
#

I'll mention here: I store my events in a queue (as a Firebase Firestore document), and immediately return a 200 status . Saving said document fires a "created" event, where I do the "real" processing - this event (cloud function) has a much longer timeout.

#

My webhook responses are generally under 100ms - and since the ONLY really valid response to a webhook is "I got it, thanks" all the other processing is asynchronous.

#

(part note: much of this is because Firebase Cloud Functions terminate almost immediately if you return a response - your mileage may vary)