fix: wrong uptime in lxc container

pull/109/head
xcsoft 3 years ago committed by GitHub
parent 3c771f9b5c
commit 669f008a8c
  1. 9
      class/core/system_api.py

@ -250,9 +250,12 @@ class system_api:
def getBootTime(self): def getBootTime(self):
# 取系统启动时间 # 取系统启动时间
start_time = psutil.boot_time() uptime = mw.readFile('/proc/uptime')
run_time = time.time() - start_time if uptime == False:
# conf = mw.readFile('/proc/uptime').split() start_time = psutil.boot_time()
run_time = time.time() - start_time
else:
run_time = uptime.split()[0]
tStr = float(run_time) tStr = float(run_time)
min = tStr / 60 min = tStr / 60
hours = min / 60 hours = min / 60

Loading…
Cancel
Save