Update ff.py
Browse files
ff.py
CHANGED
|
@@ -197,7 +197,11 @@ def create_space(type,key = "", value = ""):
|
|
| 197 |
# os.system(f"wget -O '/data/{tmp_name}/Dockerfile' https://huggingface.co/datasets/Qilan2/ff/raw/main/Dockerfile")
|
| 198 |
os.system('git add .')
|
| 199 |
os.system('git commit -m "0"')
|
| 200 |
-
os.system('git push origin main')
|
|
|
|
|
|
|
|
|
|
|
|
|
| 201 |
def get_latest_local_package(directory, pattern='*.tar.gz'):
|
| 202 |
try:
|
| 203 |
# 构建完整的搜索路径
|
|
@@ -599,7 +603,7 @@ if os.path.exists('/data/ff/.mozilla/firefox/profiles.ini') and os.path.isfile('
|
|
| 599 |
print("检测到Firefox配置,启动定期重启循环...")
|
| 600 |
response = create_space(2)
|
| 601 |
print(response)
|
| 602 |
-
time.sleep(
|
| 603 |
github(2)
|
| 604 |
response = create_space(1)
|
| 605 |
print(response)
|
|
|
|
| 197 |
# os.system(f"wget -O '/data/{tmp_name}/Dockerfile' https://huggingface.co/datasets/Qilan2/ff/raw/main/Dockerfile")
|
| 198 |
os.system('git add .')
|
| 199 |
os.system('git commit -m "0"')
|
| 200 |
+
push_result = os.system('git push origin main')
|
| 201 |
+
if push_result != 0:
|
| 202 |
+
print("推送失败,可能有冲突,尝试拉取并合并...")
|
| 203 |
+
os.system('git pull origin main --rebase')
|
| 204 |
+
os.system('git push origin main')
|
| 205 |
def get_latest_local_package(directory, pattern='*.tar.gz'):
|
| 206 |
try:
|
| 207 |
# 构建完整的搜索路径
|
|
|
|
| 603 |
print("检测到Firefox配置,启动定期重启循环...")
|
| 604 |
response = create_space(2)
|
| 605 |
print(response)
|
| 606 |
+
time.sleep(20)#21600 = 6小时
|
| 607 |
github(2)
|
| 608 |
response = create_space(1)
|
| 609 |
print(response)
|