修改i清理方式
This commit is contained in:
parent
9f075077ba
commit
1ec9f3c922
@ -5,6 +5,7 @@ import psutil
|
|||||||
from api import XiGuaLiveApi
|
from api import XiGuaLiveApi
|
||||||
import json
|
import json
|
||||||
from bilibili import Bilibili
|
from bilibili import Bilibili
|
||||||
|
import threading
|
||||||
|
|
||||||
_config_fp = open("config.json","r",encoding="utf8")
|
_config_fp = open("config.json","r",encoding="utf8")
|
||||||
config = json.load(_config_fp)
|
config = json.load(_config_fp)
|
||||||
@ -55,6 +56,10 @@ def getCurrentStatus():
|
|||||||
_mem = psutil.virtual_memory()
|
_mem = psutil.virtual_memory()
|
||||||
_net = psutil.net_io_counters()
|
_net = psutil.net_io_counters()
|
||||||
_delta= getTimeDelta(datetime.now(),network["currentTime"])
|
_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:
|
if 60 > _delta > 0:
|
||||||
_inSpeed = (_net.bytes_recv - network["in"]["currentByte"])/_delta
|
_inSpeed = (_net.bytes_recv - network["in"]["currentByte"])/_delta
|
||||||
_outSpeed = (_net.bytes_sent - network["out"]["currentByte"])/_delta
|
_outSpeed = (_net.bytes_sent - network["out"]["currentByte"])/_delta
|
||||||
|
Reference in New Issue
Block a user