Thun09 commited on
Commit
6abce40
·
1 Parent(s): 9d57a1e

Update space

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -5,10 +5,11 @@ from apscheduler.schedulers.background import BackgroundScheduler
5
 
6
  from src.envs import API, REPO_ID, TOKEN
7
 
8
- from utils import get_data, submit
9
 
10
 
11
  def restart_space():
 
12
  API.restart_space(repo_id=REPO_ID)
13
 
14
 
@@ -66,6 +67,6 @@ with gr.Blocks() as demo:
66
  submit_button.click(submit, file_upload, submission_result)
67
 
68
  scheduler = BackgroundScheduler()
69
- scheduler.add_job(restart_space, "interval", seconds=1800)
70
  scheduler.start()
71
  demo.queue(default_concurrency_limit=40).launch()
 
5
 
6
  from src.envs import API, REPO_ID, TOKEN
7
 
8
+ from utils import get_data, submit, refresh
9
 
10
 
11
  def restart_space():
12
+ refresh()
13
  API.restart_space(repo_id=REPO_ID)
14
 
15
 
 
67
  submit_button.click(submit, file_upload, submission_result)
68
 
69
  scheduler = BackgroundScheduler()
70
+ scheduler.add_job(restart_space, "interval", seconds=30)
71
  scheduler.start()
72
  demo.queue(default_concurrency_limit=40).launch()