Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -275,8 +275,8 @@ def restart_space():
|
|
275 |
preload_gt()
|
276 |
# run_gradio()
|
277 |
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
interface.launch(show_error=True)
|
|
|
275 |
preload_gt()
|
276 |
# run_gradio()
|
277 |
|
278 |
+
scheduler = BackgroundScheduler()
|
279 |
+
scheduler.add_job(restart_space, "interval", hours=2) # Restart every 1h
|
280 |
+
logging.info("Scheduler initialized to restart space every 1 hour.")
|
281 |
+
scheduler.start()
|
282 |
interface.launch(show_error=True)
|