Werli commited on
Commit
b4dc928
·
verified ·
1 Parent(s): 4af4674

Update app.py

Browse files

Temporary disabled the `Restart Space Scheduler` as it's probably not necessary anymore.

Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -631,11 +631,11 @@ def _restart_space():
631
  )
632
 
633
  # Setup scheduler for periodic restarts
634
- scheduler = BackgroundScheduler()
635
- restart_space_job = scheduler.add_job(_restart_space, 'interval', seconds=172800)
636
- scheduler.start()
637
- next_run_time_utc = restart_space_job.next_run_time.astimezone(timezone.utc)
638
- NEXT_RESTART = f"Next Restart: {next_run_time_utc.strftime('%Y-%m-%d %H:%M:%S')} (UTC) - The space will restart every 2 days to ensure stability and performance. It uses a background scheduler to handle the restart process."
639
 
640
 
641
  with gr.Blocks(title=TITLE, css=css, theme="Werli/Purple-Crimson-Gradio-Theme", fill_width=True) as demo:
@@ -843,6 +843,6 @@ with gr.Blocks(title=TITLE, css=css, theme="Werli/Purple-Crimson-Gradio-Theme",
843
  inputs=[tag_string],
844
  outputs=[cleaned_tags_output, classify_tags_for_display, generate_categorized_json]
845
  )
846
- gr.Markdown(NEXT_RESTART)
847
 
848
  demo.queue(max_size=5).launch(show_error=True, show_api=False)
 
631
  )
632
 
633
  # Setup scheduler for periodic restarts
634
+ # scheduler = BackgroundScheduler()
635
+ # restart_space_job = scheduler.add_job(_restart_space, 'interval', seconds=172800)
636
+ # scheduler.start()
637
+ # next_run_time_utc = restart_space_job.next_run_time.astimezone(timezone.utc)
638
+ # NEXT_RESTART = f"Next Restart: {next_run_time_utc.strftime('%Y-%m-%d %H:%M:%S')} (UTC) - The space will restart every 2 days to ensure stability and performance. It uses a background scheduler to handle the restart process."
639
 
640
 
641
  with gr.Blocks(title=TITLE, css=css, theme="Werli/Purple-Crimson-Gradio-Theme", fill_width=True) as demo:
 
843
  inputs=[tag_string],
844
  outputs=[cleaned_tags_output, classify_tags_for_display, generate_categorized_json]
845
  )
846
+ # gr.Markdown(NEXT_RESTART)
847
 
848
  demo.queue(max_size=5).launch(show_error=True, show_api=False)