Qilan2 commited on
Commit
b21b285
·
verified ·
1 Parent(s): 41eeb81

Update server10.py

Browse files
Files changed (1) hide show
  1. server10.py +7 -4
server10.py CHANGED
@@ -497,21 +497,22 @@ def check_system_resources():
497
  # 可选:打印具体的使用率
498
  print(f"CPU使用率: {cpu_usage}%")
499
  print(f"内存使用率: {memory_usage}%")
500
- # result = restart_huggingface_space(huggingface_user, huggingface_id, huggingface_tokon)
501
- # print(result)
502
- # time.sleep(6666666)
503
  else:
504
  print("系统资源正常")
505
 
506
 
507
  # 调用函数
508
- check_system_resources()
509
 
510
  threading.Thread(target=SillyTavern, daemon=True).start()
511
  # SillyTavern()
512
  time.sleep(60)
513
  check_api1()
514
 
 
515
  # 创建 ConfigParser 对象
516
  config = configparser.ConfigParser()
517
  # 添加一个 'general' 部分
@@ -529,6 +530,8 @@ if os.path.exists(f'/data/{huggingface_Data_name}.zip'):
529
  Service_status = True
530
  frp(configs, True)
531
  threading.Thread(target=monitor_port, daemon=True).start()#检测端口状态
 
 
532
  while True:
533
  # 检查是否是中国时区早上6点
534
  china_tz = pytz.timezone('Asia/Shanghai')
 
497
  # 可选:打印具体的使用率
498
  print(f"CPU使用率: {cpu_usage}%")
499
  print(f"内存使用率: {memory_usage}%")
500
+ result = restart_huggingface_space(huggingface_user, huggingface_id, huggingface_tokon)
501
+ print(result)
502
+ time.sleep(6666666)
503
  else:
504
  print("系统资源正常")
505
 
506
 
507
  # 调用函数
508
+
509
 
510
  threading.Thread(target=SillyTavern, daemon=True).start()
511
  # SillyTavern()
512
  time.sleep(60)
513
  check_api1()
514
 
515
+
516
  # 创建 ConfigParser 对象
517
  config = configparser.ConfigParser()
518
  # 添加一个 'general' 部分
 
530
  Service_status = True
531
  frp(configs, True)
532
  threading.Thread(target=monitor_port, daemon=True).start()#检测端口状态
533
+ check_system_resources()
534
+ time.sleep(300)
535
  while True:
536
  # 检查是否是中国时区早上6点
537
  china_tz = pytz.timezone('Asia/Shanghai')