feat: add gateway client with env-driven assembly
Includes config aggregation for multi-source env keys, from_env and from_settings factories with explicit shared-backend injection, gather_bounded, top-level exports, tightened import-linter layers with the gate removed from the Makefile, and the finalized .env.example.
This commit is contained in:
@@ -166,15 +166,19 @@ class TelemetryMW:
|
||||
response = await call_next(request)
|
||||
except (GatewayUnavailableError, GovernanceBackendError) as exc:
|
||||
await self._emitter.emit_terminal_failure(
|
||||
request=request, call_id=str(uuid.uuid4()),
|
||||
latency_ms=int((self._now() - started) * 1000), error=str(exc),
|
||||
request=request,
|
||||
call_id=str(uuid.uuid4()),
|
||||
latency_ms=int((self._now() - started) * 1000),
|
||||
error=str(exc),
|
||||
)
|
||||
raise
|
||||
except asyncio.CancelledError:
|
||||
# 尽力而为: 取消也留痕(§5.1 约定④);随后立即重抛
|
||||
await self._emitter.emit_terminal_failure(
|
||||
request=request, call_id=str(uuid.uuid4()),
|
||||
latency_ms=int((self._now() - started) * 1000), error="cancelled",
|
||||
request=request,
|
||||
call_id=str(uuid.uuid4()),
|
||||
latency_ms=int((self._now() - started) * 1000),
|
||||
error="cancelled",
|
||||
)
|
||||
raise
|
||||
if response.cache_hit:
|
||||
|
||||
Reference in New Issue
Block a user