8

My api returns me a result after 10 minute later because of some limitations of another api. In localhost, i can wait 10 minutes and receive my data successfully but in vercel, my api returns me 504 which means timeout error. How can i disable that?

enter image description here

questiontoansw
  • 307
  • 5
  • 17
  • Are you asking how to handle/configure timeouts in your code or at Vercel itself? – Mark G Apr 25 '22 at 03:48
  • I don't know which one is throwing me that error so... You can give your thoughts to me for both cases. – questiontoansw Apr 25 '22 at 03:53
  • 1
    Since you mentioned 10 minutes specifically, it sounds like you're on Vercel's Hobby plan according to [this chart](https://vercel.com/docs/concepts/limits/overview#general-limits)? (Edit: I read that chart incorrectly, it's 10 seconds for Hobby) If so, you'd have to upgrade plans to get a longer timeout. If you want to do something via code, I'd look for examples on how to implement a timeout with [`AbortController`](https://developer.mozilla.org/en-US/docs/Web/API/AbortController). – Mark G Apr 25 '22 at 04:00
  • Does this answer your question? [nextjs configure to avoid http server timeout](https://stackoverflow.com/questions/61007941/nextjs-configure-to-avoid-http-server-timeout) – Ali Khoshgoftar Apr 25 '22 at 04:02
  • Thanks Ali but i tried it out but didn't work. – questiontoansw Apr 25 '22 at 16:03

0 Answers0