Qilan2 commited on
Commit
3742fd0
·
verified ·
1 Parent(s): a3e080f

Update server.py

Browse files
Files changed (1) hide show
  1. server.py +7 -22
server.py CHANGED
@@ -318,20 +318,6 @@ def check_api1():
318
  # break # 跳出循环
319
  else:
320
  print("接口返回信息:", response_json)
321
-
322
- # except requests.exceptions.HTTPError as e:
323
- # if e.response.status_code == 403:
324
- # print("接口正常2") # 再次确认服务已启动
325
- # try:
326
- # subprocess.run(f"rsync -avz -e 'ssh -p {ssh_port} -o StrictHostKeyChecking=no' root@{frp_url}:/sillytavern/ /sillytavern/", shell=True, check=True)
327
- # except subprocess.CalledProcessError as e:
328
- # print(f"Rsync failed with return code: {e.returncode}")
329
- # print(f"Command output: {e.output}")
330
- # if thread_started:
331
- # subprocess.run(f"rsync -avz -e 'ssh -p {ssh_port} -o StrictHostKeyChecking=no' root@{frp_url}:/sillytavern/ /sillytavern/", shell=True, check=True)
332
- # threading.Thread(target=sync, daemon=True).start()
333
- # thread_started = True # 设置标志为 True,表示线程已经启动过了
334
- # break
335
 
336
  except requests.exceptions.ConnectionError as e:
337
  print(f"接口异常1: {e}")
@@ -413,13 +399,12 @@ def SillyTavern():
413
  # 'yes | sh start.sh -y'
414
  # ]
415
  # run_commands(commands)
416
- # SillyTavern()
417
  # threading.Thread(target=SillyTavern, daemon=True).start()
418
  # check_api1()
419
- # threading.Thread(target=repeat_task, daemon=True).start() #压缩备份
420
- # print("开始衔接")
421
- # Service_status = True
422
- # frp(config_data2,'/content/frp/frpc2.ini',True)
423
- # frp(config_data,'/content/frp/frpc.ini',False)
424
- # sync()
425
- compress_folder()
 
318
  # break # 跳出循环
319
  else:
320
  print("接口返回信息:", response_json)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
321
 
322
  except requests.exceptions.ConnectionError as e:
323
  print(f"接口异常1: {e}")
 
399
  # 'yes | sh start.sh -y'
400
  # ]
401
  # run_commands(commands)
402
+
403
  # threading.Thread(target=SillyTavern, daemon=True).start()
404
  # check_api1()
405
+ threading.Thread(target=repeat_task, daemon=True).start() #压缩备份
406
+ print("开始衔接")
407
+ Service_status = True
408
+ frp(config_data2,'/content/frp/frpc2.ini',True)
409
+ frp(config_data,'/content/frp/frpc.ini',False)
410
+