fix(critical): SyntaxError — global _question_counter vor try-Block verschoben
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).
This commit is contained in:
+1
-2
@@ -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 ──────────────────────────────
|
||||
|
||||
Reference in New Issue
Block a user