chejian commited on
Commit
e5d95c8
1 Parent(s): 7bf15ca

Update space restart

Browse files
Files changed (1) hide show
  1. app.py +9 -1
app.py CHANGED
@@ -31,7 +31,15 @@ from src.submission.submit import add_new_eval
31
 
32
 
33
  def restart_space():
34
- API.restart_space(repo_id=REPO_ID, token=TOKEN)
 
 
 
 
 
 
 
 
35
 
36
 
37
  try:
 
31
 
32
 
33
  def restart_space():
34
+ restart = False
35
+ while not restart:
36
+ try:
37
+ API.restart_space(repo_id=REPO_ID, token=TOKEN)
38
+ except requests.exceptions.ConnectionError as e:
39
+ print("Restart failed. Re-trying...")
40
+ time.sleep(30)
41
+ continue
42
+ restart = True
43
 
44
 
45
  try: