From 7d465ba728aab0100567ccbaebc629555f8af144 Mon Sep 17 00:00:00 2001 From: OmShukla-07 Date: Mon, 1 Dec 2025 02:46:22 +0530 Subject: [PATCH] Fix: Add missing await keyword in authentication dependency and make Weaviate non-blocking --- backend/app/core/dependencies.py | 2 +- backend/main.py | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/backend/app/core/dependencies.py b/backend/app/core/dependencies.py index a06208d..59f168a 100644 --- a/backend/app/core/dependencies.py +++ b/backend/app/core/dependencies.py @@ -47,7 +47,7 @@ async def get_current_user(authorization: str = Header(None)) -> UUID: try: supabase = get_supabase_client() # Verify the token and get user - user_response = supabase.auth.get_user(token) + user_response = await supabase.auth.get_user(token) if not user_response or not user_response.user: raise HTTPException( diff --git a/backend/main.py b/backend/main.py index b7ad80a..578d015 100644 --- a/backend/main.py +++ b/backend/main.py @@ -68,8 +68,9 @@ async def test_weaviate_connection(self): if await client.is_ready(): logger.info("Weaviate connection successful and ready") except Exception as e: - logger.error(f"Failed to connect to Weaviate: {e}") - raise + logger.warning(f"Failed to connect to Weaviate during startup: {e}") + logger.warning("Continuing without Weaviate - some features may not work") + # Don't raise - allow backend to start even if Weaviate is unavailable async def stop_background_tasks(self): """Stops all background tasks and connections gracefully."""