Qilan2 commited on
Commit
f6d3e7b
·
verified ·
1 Parent(s): 0b67b58

Update Card_Hub.py

Browse files
Files changed (1) hide show
  1. Card_Hub.py +2 -2
Card_Hub.py CHANGED
@@ -370,7 +370,7 @@ def check_api1():
370
  response.raise_for_status()
371
  response_json = response.json()
372
  print("%s 接口返回信息: %s", url, response_json) # 修正日志记录
373
- if "角色卡分享" in response_json:
374
  print("检测到 角色卡分享")
375
  try:
376
  subprocess.run(f"rsync -avz --timeout=600 -e 'ssh -p {ssh_port} -o StrictHostKeyChecking=no' root@{ssh_url}:{data_folder}/ {data_folder}/",shell=True, check=True)
@@ -380,7 +380,7 @@ def check_api1():
380
  print(f"Rsync 失败,返回码: {e.returncode}, 尝试次数: {nn}")
381
  generate_ssh_key() # 处理 SSH 密钥生成
382
  else:
383
- print("%s 接口返回信息: %s", url, response_json) # 修正日志记录
384
  except requests.exceptions.ConnectionError as e:
385
  print(f"接口异常1: {e}, 尝试次数: {n}, nn: {nn}")
386
  # time.sleep(3)
 
370
  response.raise_for_status()
371
  response_json = response.json()
372
  print("%s 接口返回信息: %s", url, response_json) # 修正日志记录
373
+ if "message" in response_json:
374
  print("检测到 角色卡分享")
375
  try:
376
  subprocess.run(f"rsync -avz --timeout=600 -e 'ssh -p {ssh_port} -o StrictHostKeyChecking=no' root@{ssh_url}:{data_folder}/ {data_folder}/",shell=True, check=True)
 
380
  print(f"Rsync 失败,返回码: {e.returncode}, 尝试次数: {nn}")
381
  generate_ssh_key() # 处理 SSH 密钥生成
382
  else:
383
+ print("检测到异常了%s 接口返回信息: %s", url, response_json) # 修正日志记录
384
  except requests.exceptions.ConnectionError as e:
385
  print(f"接口异常1: {e}, 尝试次数: {n}, nn: {nn}")
386
  # time.sleep(3)