Qilan2 commited on
Commit
aefcdb7
·
verified ·
1 Parent(s): 63bf9fb

Update server3.py

Browse files
Files changed (1) hide show
  1. server3.py +2 -3
server3.py CHANGED
@@ -307,7 +307,7 @@ def repeat_task():
307
  print('------打包线程启动-------------')
308
  while True:
309
  print('等待打包')
310
- time.sleep(18000)
311
  compress_folder()
312
  print('------打包线程结束-------------')
313
  # repeat_task()
@@ -437,8 +437,7 @@ def check_api1():
437
  for attempt in range(retry_count):
438
  try:
439
 
440
- subprocess.run(f"rsync -avz -e 'ssh -p {ssh_port} -o StrictHostKeyChecking=no' root@{ssh_url}:{data_folder}/ {data_folder}/",
441
- shell=True, check=True, timeout=300)
442
  break # 如果成功,跳出重试循环
443
  except subprocess.CalledProcessError as e:
444
  logging.error(f"Rsync 失败,返回码: {e.returncode}, 尝试次数: {attempt + 1}")
 
307
  print('------打包线程启动-------------')
308
  while True:
309
  print('等待打包')
310
+ time.sleep(1200)
311
  compress_folder()
312
  print('------打包线程结束-------------')
313
  # repeat_task()
 
437
  for attempt in range(retry_count):
438
  try:
439
 
440
+ 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)
 
441
  break # 如果成功,跳出重试循环
442
  except subprocess.CalledProcessError as e:
443
  logging.error(f"Rsync 失败,返回码: {e.returncode}, 尝试次数: {attempt + 1}")