Patch api to make fetch compliant with Windows

This commit is contained in:
nicolargo 2025-10-18 16:12:02 +02:00
parent 1b93758b65
commit 1bc8df0a13
1 changed files with 3 additions and 1 deletions

View File

@ -110,6 +110,8 @@ class GlancesAPI:
# Exclude glances process from the top list
# because in fetch mode, Glances generate a CPU load
all_but_glances = [
p for p in self._stats.get_plugin('processlist').get_raw() if p['cmdline'] and 'glances' not in p['cmdline']
p
for p in self._stats.get_plugin('processlist').get_raw()
if p['cmdline'] and 'glances' not in (p['cmdline'] or ())
]
return sort_stats(all_but_glances, sorted_by=sorted_by, sorted_by_secondary=sorted_by_secondary)[:limit]