cthit / VoteIT

Voting website hosted on a node.js server
MIT License
4 stars 29 forks source link

Heroku timeout #49

Closed Dr-Horv closed 8 years ago

Dr-Horv commented 8 years ago

When no web requests are made to heroku the instances "sleeps" and the state is lost and new code have to be generated.

lindskogen commented 8 years ago

"SLEEPS AFTER 30 MINS OF INACTIVITY" Source: https://www.heroku.com/pricing

bark commented 8 years ago

Is this a problem? what do you mean with state is lost?

lindskogen commented 8 years ago

Application "sleeps" which makes it lose its internal state. - Is codes generated, and so on.

This actually happened during the last meeting

bark commented 8 years ago

hmm, yea that is a problem, can wee poke it every 10 minutes? or have some process that always work? or premium?

lindskogen commented 8 years ago

Yeah, we were planning on testing the health-check endpoint tomorrow :)

lindskogen commented 8 years ago

Ok, after some testing, the app actually seems to sleep after 30 min and all state is lost.

We were able to keep it alive using the following script:

while true; do
    curl -s https://$SERVERNAME/health-check
    sleep 60
done;

Adding a note to the readme file