mirror of
https://github.com/nicolargo/glances.git
synced 2024-08-17 00:10:48 +03:00
Call process_iter.clear_cache() (PsUtil 6+) when Glances user force a refresh (F5 or CTRL-R) #2753
This commit is contained in:
parent
e5d5351d31
commit
cff2e9fc4a
@ -370,7 +370,7 @@ class _GlancesCurses:
|
||||
logger.info(f"Stop Glances (keypressed: {self.pressedkey})")
|
||||
|
||||
def _handle_refresh(self):
|
||||
pass
|
||||
glances_processes.reset_internal_cache()
|
||||
|
||||
def loop_position(self):
|
||||
"""Return the current sort in the loop"""
|
||||
|
@ -119,6 +119,12 @@ class GlancesProcesses:
|
||||
"""Set args."""
|
||||
self.args = args
|
||||
|
||||
def reset_internal_cache(self):
|
||||
"""Reset the internal cache."""
|
||||
self.cache_timer = Timer(0)
|
||||
self.processlist_cache = {}
|
||||
psutil.process_iter.cache_clear()
|
||||
|
||||
def reset_processcount(self):
|
||||
"""Reset the global process count"""
|
||||
self.processcount = {'total': 0, 'running': 0, 'sleeping': 0, 'thread': 0, 'pid_max': None}
|
||||
|
Loading…
Reference in New Issue
Block a user