修复运行时间错误的问题

This commit is contained in:
2024-10-05 03:21:01 +08:00
parent 3fa94f653d
commit c2a3966f37
4 changed files with 145 additions and 0 deletions

View File

@ -6,6 +6,8 @@ from typing import Any
import psutil
import requests
from server_status.timezone import get_timezone
excluded_partition_prefix = ("/var", "/boot", "/run", "/proc", "/sys", "/dev", "/tmp", "/snap")
@ -39,6 +41,8 @@ class Hardware:
disks: dict[str, dict[str, int]] = {}
timezone: str = get_timezone()
net_up: int = 0
net_down: int = 0
net_type: str = "ethernet"
@ -190,6 +194,7 @@ class Client:
"start_time": int(self.start_time), # 系统启动的时间
"link": self.link,
"observed_at": int(time.time()),
"timezone": self.hardware.timezone,
},
"hardware": {
"mem": {