1
0
mirror of https://github.com/newnius/YAO-agent.git synced 2025-06-06 05:21:55 +00:00
This commit is contained in:
Newnius 2020-07-02 20:11:52 +08:00
parent 96366c98a3
commit 4e00236b03

View File

@ -70,11 +70,14 @@ def monitor_task(container_id):
last_time = time.time() - 1
for statR in container.stats():
if pid == 0:
res = container.top()['Processes']
for x in res:
if "/workspace" in x[7] and int(x[1]) in active_stats:
pid = int(x[1])
break
try:
res = container.top()['Processes']
for x in res:
if "/workspace" in x[7] and int(x[1]) in active_stats:
pid = int(x[1])
break
except Exception as e:
print("[WARN]", str(e))
stat = json.loads(statR)
# print(stat)