How to add keepalive in python

Im trying to add a keepalive.py to my python repl to ping it with uptimerobot but it wont work, ive tried it with js before and it works but i dont know why it wont work with python does anyone know how to make it work

hi @DBTprods ,
basically replit force shuts down repls to save resources. Think about it, if you had your computer running a program. forever. Never stopping and it runs with essentially infinite resources and never stops even when it does absolutely nothing. That’s basically most repls so replit will shut down repls after x amount of inactivity. Then, running it again will wake it up. Although you are probably running a separate Thread. Threads work as follows: after finishing the main thread in your program, the code will set itself to being done but if another thread is running, this thread will continue after. However, if the entire repl gets shut down, then all threads are closed so basically running another thread is a cheap party trick for the UI. Basically, you can’t run the pinger in your repl so try running an external pinger. This will work for the very current ecosystem but replit is migrating to new systems so I can’t say this will work for much longer.
If this helped, please mark as solve
Warm Regards,
@bigminiboss

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.