Update space restart
Browse files
app.py
CHANGED
|
@@ -31,7 +31,15 @@ from src.submission.submit import add_new_eval
|
|
| 31 |
|
| 32 |
|
| 33 |
def restart_space():
|
| 34 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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:
|