Spaces:
Runtime error
Runtime error
| import time | |
| def keep_alive(): | |
| """ | |
| Keeps the Space alive by printing a message every 30 seconds. | |
| """ | |
| print("Starting keep-alive loop. Press Ctrl+C to exit.") | |
| try: | |
| while True: | |
| # This print statement is what keeps the process active. | |
| print("🚀 Keeping the Space alive...") | |
| time.sleep(30) | |
| except KeyboardInterrupt: | |
| print("\nExiting keep-alive loop.") | |
| if __name__ == "__main__": | |
| keep_alive() |