Why does application restart sometimes?


#1

Just, like in title, my application restarts after x minutes, so it makes me unable to do code with storing data in variables :confused:

The question is, how can I disable it ?


#2

Projects on Glitch sleep after 5 minutes if they are not used, and wake again whenever a new request comes in and that restarts your project. If you want data to persist, you need to save it to the file system or store it in a database. We have a collection of starter apps showing how to use various options at https://glitch.com/storage


#3

Oooor… I can make setInterval with GET?


#4

We sometimes need to restart projects after maintenance updates and the like. As such, we don’t recommend using setInterval to force projects awake.


#5

So maybe a website pinger ?


#6

That’s a better approach. I’d still recommend you storing the data in some way other than variables if it’s important it’s retained. Errors in the functioning of the app may still cause it to restart unexpectedly.