So before posting here I’ve spent a couple of days trying to figure this out, watched almost every YouTube out there about this but to no avail.
What I am trying to do is to have a bot that checks for delays on flights and then posts them on Facebook every 30mins. The code runs fine but for the life of me I can’t figure out how to keep it running on replit. I have the keep_alive class imported and have the method
keep_alive.keep_alive() function invoked in my
__name__ = '__main__' function but it still dies after 1 hour of closing the tab.
I have set uptime robot and it’s pinging the server as intended as I can see it pinging for HEAD every 5 minutes on the console when I have Replit open:
Would appreciate any tips to what I am doing wrong or any other alternative.
Thank you very much
Hey @KhalilAyari1, you may want to consider Always On for this.
Hey lilchiky, Thank you for the tip, did not know about this feature. Any idea if there is a way to keep the script running without paying for an upgrade ? The project is just too small for me to justify paying for it.
Hmm, let me think…
You can try gdaybot by just typing in the comments,
keepalive to keep your Repl awake, though it only works if it has a webserver. (It’s completely free)
This probably has some more information.
Thank you very much. I will give it a shot otherwise I’ll give pythoneverywhere a shot
keep alive command was shut down. There is no reliable or guaranteed way to keep your Repl alive via pingers. Also pingers may drain your Outbound Data (I’m not sure but I would assume). Sadly the best option is to pay Replit using either Always On or Deployments.
Differences between Always On and Deployments
- Comes with the Hacker and Pro Plans
- Merely restarts your Repl after it auto shuts down
- Boosted resources not included but can be added (and also come with paid plans)
- Newer (and may one day replace Always On (this is my speculation))
- More expensive
- Not included in any plan at the moment
IIRC both can be paid for in cycles.