This commit is contained in:
cppla 2022-03-23 11:13:18 +08:00
parent c46d0c06cd
commit 30f9999fc6
2 changed files with 12 additions and 4 deletions

@ -210,7 +210,11 @@ def _net_speed():
netSpeed["avgtx"] = avgtx netSpeed["avgtx"] = avgtx
time.sleep(INTERVAL) time.sleep(INTERVAL)
def get_realtime_date(): def get_realtime_data():
'''
real time get system data
:return:
'''
t1 = threading.Thread( t1 = threading.Thread(
target=_ping_thread, target=_ping_thread,
kwargs={ kwargs={
@ -273,7 +277,7 @@ if __name__ == '__main__':
elif 'INTERVAL' in argc: elif 'INTERVAL' in argc:
INTERVAL = int(argc.split('INTERVAL=')[-1]) INTERVAL = int(argc.split('INTERVAL=')[-1])
socket.setdefaulttimeout(30) socket.setdefaulttimeout(30)
get_realtime_date() get_realtime_data()
while True: while True:
try: try:
print("Connecting...") print("Connecting...")

@ -190,7 +190,11 @@ def _net_speed():
netSpeed["avgtx"] = avgtx netSpeed["avgtx"] = avgtx
time.sleep(INTERVAL) time.sleep(INTERVAL)
def get_realtime_date(): def get_realtime_data():
'''
real time get system data
:return:
'''
t1 = threading.Thread( t1 = threading.Thread(
target=_ping_thread, target=_ping_thread,
kwargs={ kwargs={
@ -253,7 +257,7 @@ if __name__ == '__main__':
elif 'INTERVAL' in argc: elif 'INTERVAL' in argc:
INTERVAL = int(argc.split('INTERVAL=')[-1]) INTERVAL = int(argc.split('INTERVAL=')[-1])
socket.setdefaulttimeout(30) socket.setdefaulttimeout(30)
get_realtime_date() get_realtime_data()
while 1: while 1:
try: try:
print("Connecting...") print("Connecting...")