Added a catch for psutils if process get stopped by user

This commit is contained in:
Mokaddem 2017-02-28 16:13:01 +01:00
parent 75b4037519
commit a2849c1bcd

View file

@ -644,6 +644,12 @@ def fetchQueueData():
if len(CPU_TABLE[moduleNum]) > args.refresh*10: if len(CPU_TABLE[moduleNum]) > args.refresh*10:
CPU_TABLE[moduleNum].pop() CPU_TABLE[moduleNum].pop()
mem_percent = CPU_OBJECT_TABLE[int(moduleNum)].memory_percent() mem_percent = CPU_OBJECT_TABLE[int(moduleNum)].memory_percent()
except psutil.NoSuchProcess:
del CPU_OBJECT_TABLE[int(moduleNum)]
del CPU_TABLE[moduleNum]
cpu_percent = 0
cpu_avg = cpu_percent
mem_percent = 0
except KeyError: except KeyError:
try: try:
CPU_OBJECT_TABLE[int(moduleNum)] = psutil.Process(int(moduleNum)) CPU_OBJECT_TABLE[int(moduleNum)] = psutil.Process(int(moduleNum))