Qilan2 commited on
Commit
ca70817
·
verified ·
1 Parent(s): 24c32e8

Update server2.py

Browse files
Files changed (1) hide show
  1. server2.py +8 -8
server2.py CHANGED
@@ -331,14 +331,14 @@ def check_api1():
331
  print(url,"接口返回信息:", response_json)
332
  if "token" in response_json:
333
  print("检测到 token")
334
- # try:
335
- # subprocess.run(f"rsync -avz -e 'ssh -p {ssh_port} -o StrictHostKeyChecking=no' root@{frp_url}:/sillytavern/ /sillytavern/", shell=True, check=True)
336
- # except subprocess.CalledProcessError as e:
337
- # print(f"Rsync failed with return code: {e.returncode}")
338
- # print(f"Command output: {e.output}")
339
  # subprocess.run(f"rsync -avz -e 'ssh -p {ssh_port} -o StrictHostKeyChecking=no' root@{frp_url}:/sillytavern/ /sillytavern/", shell=True, check=True)
340
- subprocess.run(f"sh /sync.sh -p {ssh_port} -s {frp_url}", shell=True, check=True)
341
- break # 跳出循环
342
  else:
343
  print("接口返回信息:", response_json)
344
 
@@ -357,7 +357,7 @@ def check_api1():
357
  # threading.Thread(target=Frpc, daemon=True).start()
358
  break
359
 
360
- time.sleep(5) # 等待5秒后重试
361
 
362
 
363
  def frp(config_data1,config_file_path,backstage):
 
331
  print(url,"接口返回信息:", response_json)
332
  if "token" in response_json:
333
  print("检测到 token")
334
+ try:
335
+ subprocess.run(f"rsync -avz -e 'ssh -p {ssh_port} -o StrictHostKeyChecking=no' root@{frp_url}:/sillytavern/ /sillytavern/", shell=True, check=True)
336
+ except subprocess.CalledProcessError as e:
337
+ print(f"Rsync failed with return code: {e.returncode}")
338
+ print(f"Command output: {e.output}")
339
  # subprocess.run(f"rsync -avz -e 'ssh -p {ssh_port} -o StrictHostKeyChecking=no' root@{frp_url}:/sillytavern/ /sillytavern/", shell=True, check=True)
340
+ # subprocess.run(f"sh /sync.sh -p {ssh_port} -s {frp_url}", shell=True, check=True)
341
+ # break # 跳出循环
342
  else:
343
  print("接口返回信息:", response_json)
344
 
 
357
  # threading.Thread(target=Frpc, daemon=True).start()
358
  break
359
 
360
+ time.sleep(2) # 等待5秒后重试
361
 
362
 
363
  def frp(config_data1,config_file_path,backstage):