From 53a05f45e435d8bf020e48e0e2d073f75bb152a6 Mon Sep 17 00:00:00 2001 From: Michael SCHAL Date: Mon, 1 Dec 2025 13:05:49 +0100 Subject: [PATCH] fix: Remove auto-initialization of TrackingScraperService to fix Amazon scraper TrackingScraperService now initializes on-demand instead of at startup. This prevents connection conflicts with AmazonScraperService and ImprovedSearchService since all services connect to the same Browserless instance. Fixes: Amazon scraper blocking issue (page too small - 2065 bytes) --- app/main.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/app/main.py b/app/main.py index 323f618..3e0c80e 100644 --- a/app/main.py +++ b/app/main.py @@ -151,9 +151,8 @@ async def lifespan(app: FastAPI): logger.info("Initializing Improved Search Service...") await improved_search_service.initialize() - # Initialize Tracking Scraper Service - logger.info("Initializing Tracking Scraper Service...") - await TrackingScraperService.initialize() + # Note: TrackingScraperService is initialized on-demand (not at startup) + # to avoid connection conflicts with other browser services logger.info("Application started") yield @@ -162,7 +161,7 @@ async def lifespan(app: FastAPI): stop_catalog_scheduler() await amazon_scraper_service.shutdown() await improved_search_service.shutdown() - await TrackingScraperService.shutdown() + # TrackingScraperService shutdown is handled on-demand logger.info("Application shutdown complete")