浏览代码

Merge remote-tracking branch 'origin/master'

GXX 3 月之前
父节点
当前提交
1577d54e47
共有 2 个文件被更改,包括 11 次插入1 次删除
  1. 5 0
      README.md
  2. 6 1
      check_stat.py

+ 5 - 0
README.md

@@ -43,4 +43,9 @@ https://siliconflow.cn/
 启动
 启动
 ```
 ```
 python main.py
 python main.py
+```
+
+启动服务状态检测
+```
+python check_stat.py
 ```
 ```

+ 6 - 1
check_stat.py

@@ -70,7 +70,12 @@ def main():
             else:
             else:
                 # 状态未变化,打印当前状态
                 # 状态未变化,打印当前状态
                 status_text = "在线" if is_service_online else "离线"
                 status_text = "在线" if is_service_online else "离线"
-                print(f"服务状态: {status_text}")
+                # 获取当前时间的时间元组
+                current_time = time.localtime()
+
+                # 格式化输出年月日时分秒
+                formatted_time = time.strftime("%Y年%m月%d日 %H:%M:%S", current_time)
+                print(f"{formatted_time} 服务状态: {status_text}")
             
             
             # 等待下次检查
             # 等待下次检查
             time.sleep(CHECK_INTERVAL)
             time.sleep(CHECK_INTERVAL)