Search code examples
javascriptnode.jsheroku

Why Is Heroku Server Restarting Without Any Reason?


I have a small game that I made for some friends, nothing big or important, so I am trying to keep it as possible. I uploaded it to heroku, everything seemed to be working fine, until I heard form some friends that their accounts keep getting deleted, and all the user levels on the game keep getting deleted. I was confused, because the users and levels are all stored in objects, and I had added no way to delete them (trust me). Whats more interesting is that I did a test, restarting my local server and my Heroku server at the same time adding an account to both, adding a level to each of those accounts, saving everything, and closing those tabs. I went back 15 minuets later and checked that both accounts and levels were still there (they were) and then closing the tabs again and going to take a break for a while (5 hours ish). When I came back, the local version still had the account and the level, while the heroku version did not have the account or the level. I had done nothing to the server (no updates, no restarts), and no one had visited the site while I was taking a break. The only thing that I could see that would cause this problem is that heroku is running heroku restart in the back every so often to clean up lag. Is this the case, and if so, is there a way to stop it?


Solution

  • If you are using the free plan the application sleeps after 30 minutes.