Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
eduagarcia
commited on
Commit
•
39b7a5d
1
Parent(s):
94177ff
wrap update_dynamic_files
Browse files
app.py
CHANGED
@@ -501,9 +501,16 @@ with demo:
|
|
501 |
show_copy_button=True,
|
502 |
)
|
503 |
"""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
504 |
scheduler = BackgroundScheduler()
|
505 |
scheduler.add_job(restart_space, "interval", seconds=10800) # restarted every 3h
|
506 |
-
scheduler.add_job(
|
507 |
scheduler.start()
|
508 |
|
509 |
demo.queue(default_concurrency_limit=40).launch()
|
|
|
501 |
show_copy_button=True,
|
502 |
)
|
503 |
"""
|
504 |
+
|
505 |
+
def update_dynamic_files_wrapper():
|
506 |
+
try:
|
507 |
+
return update_dynamic_files()
|
508 |
+
except Exception as e:
|
509 |
+
print(f"Error updating dynamic files: {e}")
|
510 |
+
|
511 |
scheduler = BackgroundScheduler()
|
512 |
scheduler.add_job(restart_space, "interval", seconds=10800) # restarted every 3h
|
513 |
+
scheduler.add_job(update_dynamic_files_wrapper, "cron", minute=30) # launched every hour on the hour
|
514 |
scheduler.start()
|
515 |
|
516 |
demo.queue(default_concurrency_limit=40).launch()
|