Project stops after some time


#1

i am making a discord.js bot on glitch but last night we i was hosting it it worked but in the morning i checked it was not working and i have to sign in and restart it looks like some problem with glitch


#2

Glitch projects sleep after 5 minutes of inactivity, are you doing something to keep it awake? See https://glitch.com/faq#restrictions


#3

oh yeah i fixed that by using app.get("/", (request, response) => { console.log(Date.now() + " Ping Received"); response.sendStatus(200); }); app.listen(process.env.PORT); setInterval(() => { http.get(`http://${process.env.PROJECT_DOMAIN}.glitch.me/`); }, 2800);


#4

That will work as long as we haven’t stopped your project on Glitch. We do stop projects periodically though, due to changes in the API or other infrastructure. If you really want to be sure your project will keep running, you need to hit it from an outside source.


#5

https://thelearneer.gitbooks.io/discord-js-glitch-hosting

Made this to overcome the issue @tim specified


#6

Use https://uptimerobot.com/