Help with my bot code


#1

I have code to where my bot gets pinged every 5 minutes to keep it “alive”. but when the bot is running for 24 hours it shuts down. this is the code

const http = require('http');
const express = require('express');

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/`);
}, 280000); 

any help would be great!


#2

Are you sure it stops every 24 hours? Sometimes we kill all of the running projects in Glitch. When that happens, your container won’t start again until it’s hit from the outside world.


#3

That would have been nice to mention in Not letting the App go down though.


#4

i have had someone check the bot before it allways happens after 24 hours.