proc_stats: fix stat logging when the event loop is blocked

Convert the deque to a list before slicing.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
Eric Callahan 2021-07-15 11:03:07 -04:00
parent 91f264bdaf
commit 8f8d780c72
1 changed files with 1 additions and 1 deletions

View File

@ -193,7 +193,7 @@ class ProcStats:
def log_last_stats(self, count: int = 1):
count = min(len(self.proc_stat_queue), count)
msg = ""
for stats in self.proc_stat_queue[-count:]:
for stats in list(self.proc_stat_queue)[-count:]:
msg += f"\n{self._format_stats(stats)}"
logging.info(msg)