Glitch automatically stop my project?


#1

I also added ping in my Project but glitch stop it in nighttime ?


#2

We sometimes need to restart services to apply updates, but we don’t routinely stop projects. We recommend using http requests to an end-point to wake projects for this reason, as this works around this occasional interruption.


#3

I already have that , but maybe because of that restart it is happening


#4

If you do, then your project will be woken after a request and should resume ok. Is this not happening? Or are you using a setinterval to ping your app instead?


#5

This is what I am using const http = require(‘http’);
const express = require(‘express’);
const app = 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);


#6

So that uses setInterval, which requires your project to be running and will thus get interrupted. If you used a web cron service then it hitting your project would wake it and set it going again after any interruption.