Next.js Discord

Discord Forum

Edge Function - Ping To Avoid Timeouts

Unanswered
Siamese Crocodile posted this in #help-forum
Open in Discord
Siamese CrocodileOP
I have an edge function that starts a stream and it receives the first message quite fast. However, due to cold starts with my serverless DB, there can be quite a delay between the first and second message. This stops the stream.

Have people explored sending a periodic ping with an edge function to keep it open until the upstream stream finishes? Would this work?

2 Replies

very interesting. what serverless db exactly do you use? is it Vervel version Postgres?
Red-crowned Parrot
I recommend planet scale

And maybe not using the edge run time