From 8f8d780c72ce660815b2e30aa4f929371327be0b Mon Sep 17 00:00:00 2001 From: Eric Callahan Date: Thu, 15 Jul 2021 11:03:07 -0400 Subject: [PATCH] proc_stats: fix stat logging when the event loop is blocked Convert the deque to a list before slicing. Signed-off-by: Eric Callahan --- moonraker/components/proc_stats.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/moonraker/components/proc_stats.py b/moonraker/components/proc_stats.py index fb9ceeb..9c9f148 100644 --- a/moonraker/components/proc_stats.py +++ b/moonraker/components/proc_stats.py @@ -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)