diff options
Diffstat (limited to 'services/order-executor/src/order_executor/main.py')
| -rw-r--r-- | services/order-executor/src/order_executor/main.py | 21 |
1 files changed, 5 insertions, 16 deletions
diff --git a/services/order-executor/src/order_executor/main.py b/services/order-executor/src/order_executor/main.py index d9e2373..99f88e1 100644 --- a/services/order-executor/src/order_executor/main.py +++ b/services/order-executor/src/order_executor/main.py @@ -5,6 +5,9 @@ from decimal import Decimal import aiohttp +from order_executor.config import ExecutorConfig +from order_executor.executor import OrderExecutor +from order_executor.risk_manager import RiskManager from shared.alpaca import AlpacaClient from shared.broker import RedisBroker from shared.db import Database @@ -15,10 +18,6 @@ from shared.metrics import ServiceMetrics from shared.notifier import TelegramNotifier from shared.shutdown import GracefulShutdown -from order_executor.config import ExecutorConfig -from order_executor.executor import OrderExecutor -from order_executor.risk_manager import RiskManager - # Health check port: base + 2 HEALTH_PORT_OFFSET = 2 @@ -100,12 +99,7 @@ async def run() -> None: if event.type == EventType.SIGNAL: await executor.execute(event.data) await broker.ack(stream, GROUP, msg_id) - except ( - aiohttp.ClientError, - ConnectionError, - TimeoutError, - asyncio.TimeoutError, - ) as exc: + except (aiohttp.ClientError, ConnectionError, TimeoutError) as exc: log.warning("pending_network_error", error=str(exc), msg_id=msg_id) except (ValueError, KeyError, TypeError) as exc: log.warning("pending_parse_error", error=str(exc), msg_id=msg_id) @@ -126,12 +120,7 @@ async def run() -> None: service="order-executor", event_type="signal" ).inc() await broker.ack(stream, GROUP, msg_id) - except ( - aiohttp.ClientError, - ConnectionError, - TimeoutError, - asyncio.TimeoutError, - ) as exc: + except (aiohttp.ClientError, ConnectionError, TimeoutError) as exc: log.warning("process_network_error", error=str(exc)) metrics.errors_total.labels( service="order-executor", error_type="network" |
