Spaces:
Running
Running
admin
commited on
Commit
·
293a93b
1
Parent(s):
dabf44b
restart avoid disabled
Browse files- modules/restart.py +2 -2
modules/restart.py
CHANGED
@@ -30,7 +30,7 @@ def self_restart(me="kakamond/keeps_alive"):
|
|
30 |
try:
|
31 |
spaces = HF_API.list_spaces(author=me.split("/")[0])
|
32 |
for space in spaces:
|
33 |
-
if space.id != me:
|
34 |
HF_API.restart_space(space.id)
|
35 |
|
36 |
HF_API.restart_space(me)
|
@@ -51,7 +51,7 @@ def test_hf_restart(repo: str):
|
|
51 |
repo = repo.split("/spaces/")[1].split("/")[:2]
|
52 |
repo = "/".join(repo)
|
53 |
|
54 |
-
logs = f"{HF_API.restart_space(repo)}"
|
55 |
logs += f"\nSuccessfully restart {HF_DOMAIN}/spaces/{repo}\n"
|
56 |
|
57 |
except Exception as e:
|
|
|
30 |
try:
|
31 |
spaces = HF_API.list_spaces(author=me.split("/")[0])
|
32 |
for space in spaces:
|
33 |
+
if space.id != me and not space.disabled:
|
34 |
HF_API.restart_space(space.id)
|
35 |
|
36 |
HF_API.restart_space(me)
|
|
|
51 |
repo = repo.split("/spaces/")[1].split("/")[:2]
|
52 |
repo = "/".join(repo)
|
53 |
|
54 |
+
logs = f"\n{HF_API.restart_space(repo)}\n"
|
55 |
logs += f"\nSuccessfully restart {HF_DOMAIN}/spaces/{repo}\n"
|
56 |
|
57 |
except Exception as e:
|