From dfc8ca6431a756d7d4305b1ae957fde70da18b85 Mon Sep 17 00:00:00 2001 From: Blergo Date: Tue, 2 Jul 2024 11:51:44 +0100 Subject: [PATCH] fix for server stats psutil cpu% --- command_handlers.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/command_handlers.py b/command_handlers.py index 6e25404..a66c944 100644 --- a/command_handlers.py +++ b/command_handlers.py @@ -115,6 +115,8 @@ def handle_stats_steps(sender_id, message, step, interface, bbs_nodes): send_message(response, sender_id, interface) update_user_state(sender_id, {'command': 'STATS', 'step': 2}) if choice == 1: + psutil.cpu_percent() + time.sleep(0.1) cpu = str(psutil.cpu_percent()) response = "CPU: " + cpu + "%" send_message(response, sender_id, interface)