(sorry for bad english) I have a web server in node.js (express.js), and in one route I make a external API request (POST), parse response, and send back as route response. It works ok for a while, but after 45-60 minutes of no calling that route, external API request won’t respond, and got timeout error (try/catch)
Tried with many libs (axios, fetch, http), setting timeout in 10s, 20s, 30s, 60s and even tried to keep initial connection or create a new one without success. After restart node server (I use PM2), request to external API works wihtout problem for a while. What could be the problem?
Carlos Gonzalez is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1