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:
parent
91f264bdaf
commit
8f8d780c72
|
@ -193,7 +193,7 @@ class ProcStats:
|
||||||
def log_last_stats(self, count: int = 1):
|
def log_last_stats(self, count: int = 1):
|
||||||
count = min(len(self.proc_stat_queue), count)
|
count = min(len(self.proc_stat_queue), count)
|
||||||
msg = ""
|
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)}"
|
msg += f"\n{self._format_stats(stats)}"
|
||||||
logging.info(msg)
|
logging.info(msg)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue