From 1ec9f3c9222524f09fa5df9e2e438f57bed73679 Mon Sep 17 00:00:00 2001 From: Jerry Yan <792602257@qq.com> Date: Thu, 18 Apr 2019 07:57:27 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9i=E6=B8=85=E7=90=86=E6=96=B9?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Common.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Common.py b/Common.py index 34afc1e..9bb2a11 100644 --- a/Common.py +++ b/Common.py @@ -5,6 +5,7 @@ import psutil from api import XiGuaLiveApi import json from bilibili import Bilibili +import threading _config_fp = open("config.json","r",encoding="utf8") config = json.load(_config_fp) @@ -55,6 +56,10 @@ def getCurrentStatus(): _mem = psutil.virtual_memory() _net = psutil.net_io_counters() _delta= getTimeDelta(datetime.now(),network["currentTime"]) + if getTimeDelta(datetime.now(), _do_move_time) > 3600: + p = threading.Thread(target=doClean) + p.setDaemon(True) + p.start() if 60 > _delta > 0: _inSpeed = (_net.bytes_recv - network["in"]["currentByte"])/_delta _outSpeed = (_net.bytes_sent - network["out"]["currentByte"])/_delta