Ankh
Ankh

Reputation: 31

Heroku discord bot keeps restarting

So I just recently made a discord.js bot and am currently hosting it on Heroku. However I've noticed that roughly every hour my heroku application will just randomly restart, in turn causing my bot to shut off briefly and turn back on. No reason whatsoever, no errors at all. Anyone know why this is and if there's a way to stop it?

Here's a log of what it says when it restarts:

2020-12-19T08:42:47.712115+00:00 heroku[worker.1]: Cycling
2020-12-19T08:42:47.714177+00:00 heroku[worker.1]: State changed from up to starting
2020-12-19T08:42:49.171040+00:00 heroku[worker.1]: Stopping all processes with SIGTERM
2020-12-19T08:42:49.364823+00:00 heroku[worker.1]: Process exited with status 143
2020-12-19T08:42:50.597052+00:00 heroku[worker.1]: Starting process with command `node index.js`
2020-12-19T08:42:51.347038+00:00 heroku[worker.1]: State changed from starting to up
2020-12-19T08:42:53.932302+00:00 app[worker.1]: Bot started!
2020-12-20T09:18:11.938012+00:00 heroku[worker.1]: Cycling
2020-12-20T09:18:11.945355+00:00 heroku[worker.1]: State changed from up to starting
2020-12-20T09:18:14.978039+00:00 heroku[worker.1]: Starting process with command `node index.js`
2020-12-20T09:18:15.635278+00:00 heroku[worker.1]: State changed from starting to up
2020-12-20T09:18:16.613701+00:00 heroku[worker.1]: Stopping all processes with SIGTERM
2020-12-20T09:18:16.745918+00:00 heroku[worker.1]: Process exited with status 143
2020-12-20T09:18:18.344454+00:00 app[worker.1]: Bot started!

Upvotes: 0

Views: 709

Answers (1)

Beppe C
Beppe C

Reputation: 13973

Heroku Dynos restart (cycle) every 24 hours, check the logs and you see it happens on different days.

There is nothing you can do, all Dyno types have this behaviour. One workaround is to restart the Dyno yourself (at least once a day) so you can control when this happens.

Upvotes: 1

Related Questions