Bot constantly rebooting

So recently after my project Luigi Beta ( got restored, but all of a sudden it’s starting to reboot every 4 minutes (approximately). What am I doing wrong? If someone could help it would be appreciated.

In glitch restrictions you can read about projects going to sleep after 5 minutes.

  • Projects sleep after 5 minutes if they are not used, and those running for more than 12 hours are stopped. They wake again when they receive another HTTP request to the project’s address.

You can set an UptimeRobot to make an http request to your every 5 minutes to prevent this.

To make an extra way to prevent this sleep project you can set an interval to make an auto-http request:

const http = require('http');

setInterval(() => {
}, 280000);

You can use both to make sure it keeps running. But at least use UptimeRobot

I have done this, and yet it still does not work.

try throwing in a watch.json, and then set it for 15 minutes, it will always stay up, unless uptime robot goes down for 14 minutes 53 seconds

1 Like

@tee-bee this should work ^

Could you share a code block on how to put this in the watch.json

Hey @tee-bee can you show us your UptimeRobot configuration for this project? Everything on the Glitch side seems to be in order.


That looks correct to me, and your project is properly configured to have a page to “ping” at that address, so I don’t think your Glitch project is stopping. What exactly are you seeing that makes you say this?

I do see a bunch of errors in the logs, mostly around the eval command. Perhaps those are related?

Every 4 minutes (about), it says Bot is Ready!

That’s interesting, for sure.

As I see things, that means your bot is restarting, but not necessarily that your Glitch project is restarting - if you were to uncomment!/luigibeta?path=server.js:44:0 I think that will run whenever the project itself is restarting. It also might be interesting to determine where the timestamps that are being logged right before the “Bot is Ready” message are coming from - I don’t see anything obvious in the code, but knowing what else is running right before the onReady message is published might be useful.