Our React / Next.js web app has an animation rendering part. We does image rendering, generating GIF / MP4 with Vercel serverless solution.
But typically operation does not finish in 10sec. Sometimes it is 15 sec.
What can I do? I have two ideas.
- Run cron job in every 5 sec. It checks is it any rendering not yet executed, if so, then process it.
https://vercel.com/guides/what-can-i-do-about-vercel-serverless-functions-timing-out
Does cron job has same timeout? In Heroku not.
- Do rendering not on Vercel, but make a Node.js app, and run on Heroku, where same timeout is 15sec, and it can even increase to 45 sec.
What is your opionion?