Edge Functions Not Running In Parallel
I have an app with the following architecture:
const response = await fetch(
method: 'POST',
headers: {
'Authorization':
},
body: JSON.stringify(cloudRunRequest)
});
yet it seems to create a queue of requests for the same edge function, that runs procedurally, and causes time to pile up and or me to reach the timeout of 400 seconds (pro license).
Any ideas why it happens and how can I make it multiple instances of the same edge function to truly run in parallel?
- Front received a request.
- Triggers a supabase edge function that serves as the gateway.
- Calling a google cloud run endpoint that does heavy processing that takes up to a minute.
- Response is being returned to supabase edge function for light parsing.
- Response sent back to front.
const response = await fetch(
${SUPABASE_URL}/functions/v1/<function-name>, {method: 'POST',
headers: {
'Authorization':
Bearer ${session.access_token}},
body: JSON.stringify(cloudRunRequest)
});
yet it seems to create a queue of requests for the same edge function, that runs procedurally, and causes time to pile up and or me to reach the timeout of 400 seconds (pro license).
Any ideas why it happens and how can I make it multiple instances of the same edge function to truly run in parallel?