summaryrefslogtreecommitdiff
path: root/services/data-collector/src/data_collector/main.py
diff options
context:
space:
mode:
Diffstat (limited to 'services/data-collector/src/data_collector/main.py')
-rw-r--r--services/data-collector/src/data_collector/main.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/services/data-collector/src/data_collector/main.py b/services/data-collector/src/data_collector/main.py
index 8b9f301..2d44848 100644
--- a/services/data-collector/src/data_collector/main.py
+++ b/services/data-collector/src/data_collector/main.py
@@ -4,6 +4,7 @@ import asyncio
import aiohttp
+from data_collector.config import CollectorConfig
from shared.alpaca import AlpacaClient
from shared.broker import RedisBroker
from shared.db import Database
@@ -15,8 +16,6 @@ from shared.models import Candle
from shared.notifier import TelegramNotifier
from shared.shutdown import GracefulShutdown
-from data_collector.config import CollectorConfig
-
# Health check port: base + 0
HEALTH_PORT_OFFSET = 0
@@ -48,7 +47,7 @@ async def fetch_latest_bars(
volume=Decimal(str(bar["v"])),
)
candles.append(candle)
- except (aiohttp.ClientError, ConnectionError, TimeoutError, asyncio.TimeoutError) as exc:
+ except (aiohttp.ClientError, ConnectionError, TimeoutError) as exc:
log.warning("fetch_bar_network_error", symbol=symbol, error=str(exc))
except (ValueError, KeyError, TypeError) as exc:
log.warning("fetch_bar_parse_error", symbol=symbol, error=str(exc))
@@ -98,7 +97,7 @@ async def run() -> None:
# Check if market is open
try:
is_open = await alpaca.is_market_open()
- except (aiohttp.ClientError, ConnectionError, TimeoutError, asyncio.TimeoutError):
+ except (aiohttp.ClientError, ConnectionError, TimeoutError):
is_open = False
if is_open: