Spaces:
Running
Running
admin
commited on
Commit
•
6f1f7b9
1
Parent(s):
36c5c5a
add status 4 monitor
Browse files
app.py
CHANGED
@@ -28,8 +28,10 @@ def start_monitor(url: str):
|
|
28 |
}
|
29 |
response = requests.post(f"{url}/queue/join?", json=payload)
|
30 |
# 检查请求是否成功
|
31 |
-
if response.status_code
|
32 |
-
|
|
|
|
|
33 |
|
34 |
|
35 |
def add_six_hours(match):
|
@@ -132,7 +134,7 @@ def activate_space(url: str):
|
|
132 |
response.raise_for_status()
|
133 |
|
134 |
if "-keep-spaces-active.hf.space" in url:
|
135 |
-
start_monitor(url)
|
136 |
|
137 |
except requests.exceptions.Timeout as e:
|
138 |
if ".hf.space" in url:
|
|
|
28 |
}
|
29 |
response = requests.post(f"{url}/queue/join?", json=payload)
|
30 |
# 检查请求是否成功
|
31 |
+
if response.status_code == 200:
|
32 |
+
return "monitoring"
|
33 |
+
|
34 |
+
return "running"
|
35 |
|
36 |
|
37 |
def add_six_hours(match):
|
|
|
134 |
response.raise_for_status()
|
135 |
|
136 |
if "-keep-spaces-active.hf.space" in url:
|
137 |
+
status = start_monitor(url)
|
138 |
|
139 |
except requests.exceptions.Timeout as e:
|
140 |
if ".hf.space" in url:
|