fix: Disable ImprovedSearchService auto-init to restore Amazon functionality

ImprovedSearchService and AmazonScraperService were both connecting to
Browserless at startup, causing connection conflicts and Amazon blocking
(2065 byte pages).

Now only AmazonScraperService initializes at startup, keeping Browserless
in continuous connection for Amazon. ImprovedSearchService will initialize
on-demand when needed.

This restores Amazon search to working state as it was at commit 85b19e7.
This commit is contained in:
Michael committed 2025-12-01 13:21:32 +01:00
1 parent 53a05f45e4
commit 95846ec606
1 file changed
+5 -4
+5 -4
View File
@@ -147,9 +147,10 @@ async def lifespan(app: FastAPI):
logger.info("Initializing Amazon scraper service...")
await amazon_scraper_service.initialize()
# Initialize Improved Search Service (persistent browser for Search/Comparatif)
logger.info("Initializing Improved Search Service...")
await improved_search_service.initialize()
# Note: ImprovedSearchService is initialized on-demand (not at startup)
# to avoid connection conflicts with AmazonScraperService on Browserless
# logger.info("Initializing Improved Search Service...")
# await improved_search_service.initialize()
# Note: TrackingScraperService is initialized on-demand (not at startup)
# to avoid connection conflicts with other browser services
@@ -160,7 +161,7 @@ async def lifespan(app: FastAPI):
scheduler.shutdown(wait=True)
stop_catalog_scheduler()
await amazon_scraper_service.shutdown()
await improved_search_service.shutdown()
# await improved_search_service.shutdown()
# TrackingScraperService shutdown is handled on-demand
logger.info("Application shutdown complete")