#SkyWar-webhooks
1 messages ยท Page 1 of 1 (latest)
Hello! Thanks!
So increasing the timeout might help?
Cause there are no errors on the cloud function side
no actually the recommended way of solving this is to do use the webhook endpoint just to fire async jobs
and return as fast as you can a response to the webhook request
I mean basically you get the request which it's only job is to fire another Task in a fire and forget mode
and that should handle the actions you're trying to do
the endpoint itself should not be used for heavy work
ohh okay cause currently the endpoint is responsible for reading database, updating database, generating invoice and data conversion
so yea, alot of heavy work
which means that it will probably take a lot of time and eventually we will fail the request since we didn't get any response within the window of our time-out
So basically instead of awaiting here, I directly pass okay as the status?
exports.sessionWebhook = functions.region("asia-south1").runWith({
timeoutSeconds: 90,
memory: "2GB",
}).https.onRequest(async (req, res) => {
await stripeHandler.sessionWebhook(req, res, db);
});
//Like
stripe.callFunction()
res.status(200).send()
Do you mean something like that?
I am sorry if the question is out of scope but would be great if you could guide me a bit ๐
yes something like that
where you don't await for the callFunction to end
this should only be firing another Task/Job
okay will try that out! Thanks!