mirror of
https://github.com/newnius/YAO-agent.git
synced 2025-06-06 05:21:55 +00:00
update
This commit is contained in:
parent
96366c98a3
commit
4e00236b03
13
agent.py
13
agent.py
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user