From 1969887eb7de4096c9cab04690a0fcf0a9be0f42 Mon Sep 17 00:00:00 2001 From: "Bernd (Hermes)" Date: Mon, 27 Jul 2026 16:07:51 +0200 Subject: [PATCH] =?UTF-8?q?fix(critical):=20SyntaxError=20=E2=80=94=20glob?= =?UTF-8?q?al=20=5Fquestion=5Fcounter=20vor=20try-Block=20verschoben?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Don fand beim Deployment einen SyntaxError: 'global _question_counter' war im except-Block deklariert (Python erlaubt global nur am Funktions- Anfang). Verschoben vor den try-Block, Duplikate entfernt. Gefunden von Don beim Deployment des Event-Loop-Blockade-Fixes (6990419). --- plugin/adapter.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/plugin/adapter.py b/plugin/adapter.py index 0cc00c9..15f873b 100644 --- a/plugin/adapter.py +++ b/plugin/adapter.py @@ -3119,6 +3119,7 @@ class RocketChatAdapter(BasePlatformAdapter): # P0: routing_text (ohne Quote) für Klassifikation verwenden # P0-CRITICAL: asyncio.wait_for(4s) — verhindert Event-Loop-Blockade # durch ThreadPool-Saturation (Pulse + Adapter + DDP-Fallback-Lawine). + global _question_counter try: decision = await asyncio.wait_for( self.archivar.classify_and_route(routing_text, origin_room_id=room_id, is_dm=_is_dm), @@ -3126,7 +3127,6 @@ class RocketChatAdapter(BasePlatformAdapter): ) except asyncio.TimeoutError: logger.warning("[rocketchat] Archivar classify_and_route() timed out (4s) — STAY fallback") - global _question_counter decision = RoutingDecision( category='direct_question', target_room=room_id, @@ -3153,7 +3153,6 @@ class RocketChatAdapter(BasePlatformAdapter): if (hasattr(decision, 'target_room') and decision.target_room and not getattr(decision, 'stay_in_room', False)): _THEMATIC_TARGET_ROOM.set(decision.target_room) - global _question_counter with _question_counter_lock: _question_counter += 1 # ── Ende Kontext-Weitergabe ──────────────────────────────