From b6476f945028410afa2a3a1b4d95a394ff02e08c Mon Sep 17 00:00:00 2001 From: BitterPanda63 Date: Thu, 15 May 2025 14:36:12 +0200 Subject: [PATCH 1/2] Remove STATISTICS ipc call which is unused --- aikido_zen/background_process/commands/__init__.py | 2 -- .../background_process/commands/statistics.py | 13 ------------- 2 files changed, 15 deletions(-) delete mode 100644 aikido_zen/background_process/commands/statistics.py diff --git a/aikido_zen/background_process/commands/__init__.py b/aikido_zen/background_process/commands/__init__.py index a643d3ede..601e3ec8a 100644 --- a/aikido_zen/background_process/commands/__init__.py +++ b/aikido_zen/background_process/commands/__init__.py @@ -6,7 +6,6 @@ from .user import process_user from .should_ratelimit import process_should_ratelimit from .kill import process_kill -from .statistics import process_statistics from .ping import process_ping from .sync_data import process_sync_data @@ -16,7 +15,6 @@ "ATTACK": (process_attack, False), "USER": (process_user, False), "KILL": (process_kill, False), - "STATISTICS": (process_statistics, False), # Commands that return data : "SYNC_DATA": (process_sync_data, True), "READ_PROPERTY": (process_read_property, True), diff --git a/aikido_zen/background_process/commands/statistics.py b/aikido_zen/background_process/commands/statistics.py deleted file mode 100644 index 00c29d882..000000000 --- a/aikido_zen/background_process/commands/statistics.py +++ /dev/null @@ -1,13 +0,0 @@ -"""Exports `process_statistics` function""" - - -def process_statistics(connection_manager, data, queue=None): - """Changes statistics""" - if not connection_manager or not connection_manager.statistics: - return - stats = connection_manager.statistics - - if data["action"] == "aborted_request": - stats.requests["aborted"] += 1 - elif data["action"] == "request": - stats.requests["total"] += 1 From f7e047b7e86be2f530b29c9f2a0409692374398c Mon Sep 17 00:00:00 2001 From: BitterPanda63 Date: Thu, 15 May 2025 14:38:16 +0200 Subject: [PATCH 2/2] Also remove unused IPC command KILL --- aikido_zen/background_process/commands/__init__.py | 2 -- aikido_zen/background_process/commands/kill.py | 10 ---------- 2 files changed, 12 deletions(-) delete mode 100644 aikido_zen/background_process/commands/kill.py diff --git a/aikido_zen/background_process/commands/__init__.py b/aikido_zen/background_process/commands/__init__.py index 601e3ec8a..12fc955dc 100644 --- a/aikido_zen/background_process/commands/__init__.py +++ b/aikido_zen/background_process/commands/__init__.py @@ -5,7 +5,6 @@ from .read_property import process_read_property from .user import process_user from .should_ratelimit import process_should_ratelimit -from .kill import process_kill from .ping import process_ping from .sync_data import process_sync_data @@ -14,7 +13,6 @@ # Commands that don't return data : "ATTACK": (process_attack, False), "USER": (process_user, False), - "KILL": (process_kill, False), # Commands that return data : "SYNC_DATA": (process_sync_data, True), "READ_PROPERTY": (process_read_property, True), diff --git a/aikido_zen/background_process/commands/kill.py b/aikido_zen/background_process/commands/kill.py deleted file mode 100644 index 152474a45..000000000 --- a/aikido_zen/background_process/commands/kill.py +++ /dev/null @@ -1,10 +0,0 @@ -"""exports `process_kill`""" - -import sys -from aikido_zen.helpers.logging import logger - - -def process_kill(connection_manager, data, queue=None): - """when main process quits , or during testing etc""" - logger.info("Killing background process") - sys.exit(0)