Answer the question
In order to leave comments, you need to log in
How to make a heroku app run forever i.e. how to keep the server from sleeping?
Hello!
One of the limitations of using heroku for free is that the server goes to sleep after a certain amount of time if there are no requests to it. And wakes up in a few seconds at the next call to the server.
At what, as it turned out, the server not only falls asleep, but also "resets" the application. After the next call to the server, the application returns to the "starting point".
For example:
1. An application (based on node.js) writes some results of work to a text file (I see no reason to use a database in the current situation).
2. The server goes to sleep.
3. We wake up the server - all our configs are returned to their original position. It's like I just deployed the app.
Tried:
1. Ping Google, using the "ping" module - did not work.
2. Sending requests every 2 minutes to the same Google, through the "request" module - also did not work.
Who is struggling with this?
Answer the question
In order to leave comments, you need to log in
Use https://uptimerobot.com/ , it will send requests every five minutes. From bonuses: get a notification if the server goes down :)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question