From c3484b337512815cd34b648869dfeec12cb9c147 Mon Sep 17 00:00:00 2001 From: BreakWa11 Date: Thu, 21 Jul 2016 12:58:18 +0800 Subject: [PATCH] fix uptime --- db_transfer.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/db_transfer.py b/db_transfer.py index a422aa1..c09bcfd 100644 --- a/db_transfer.py +++ b/db_transfer.py @@ -22,6 +22,7 @@ class DbTransfer(object): self.user_pass = {} self.port_uid_table = {} self.onlineuser_cache = lru_cache.LRUCache(timeout=60*30) + self.start_time = time.time() def update_all_user(self, dt_transfer): import cymysql @@ -362,7 +363,7 @@ class Dbv3Transfer(DbTransfer): return os.popen("cat /proc/loadavg | awk '{ print $1\" \"$2\" \"$3 }'").readlines()[0] def uptime(self): - return time.clock() + return time.time() - self.start_time def traffic_format(self, traffic): if traffic < 1024 * 8: