From 08b935746f52346fde093188972de9abf319646a Mon Sep 17 00:00:00 2001 From: Chuck <33324927+ChuckBuilds@users.noreply.github.com> Date: Tue, 29 Sep 2026 16:55:52 -0400 Subject: [PATCH] refactor(plugins): call PluginHealthTracker.record_hang directly The getattr/callable fallback guarded against a tracker without record_hang, but the core tracker always has it. Clears Codacy's Pylint E1102 (not-callable) false positive. Co-Authored-By: Claude Opus 5.5 --- src/plugin_system/plugin_manager.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/plugin_system/plugin_manager.py b/src/plugin_system/plugin_manager.py index 7c44fc66..5b623634 100644 --- a/src/plugin_system/plugin_manager.py +++ b/src/plugin_system/plugin_manager.py @@ -1139,19 +1139,14 @@ class PluginManager: err: Exception) -> None: """Record a hang in plugin health: a failure to the circuit breaker. - Goes through PluginHealthTracker.record_hang when the tracker has it - (it also counts the hang separately), else plain record_failure. Never + PluginHealthTracker.record_hang also counts the hang separately. Never raises: this runs on the update worker and the render thread. """ tracker = self.health_tracker if tracker is None: return try: - record_hang = getattr(tracker, 'record_hang', None) - if callable(record_hang): - record_hang(plugin_id, operation, seconds, err) - else: - tracker.record_failure(plugin_id, err) + tracker.record_hang(plugin_id, operation, seconds, err) except Exception as e: # pylint: disable=broad-except self.logger.debug("Could not record hang for %s: %s", plugin_id, e)