File tree Expand file tree Collapse file tree
src/chroma_knowledge_search/backend/app Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -54,8 +54,12 @@ def load_config():
5454 from dotenv import load_dotenv
5555
5656 load_dotenv ()
57- except Exception :
58- pass # .env file may not exist in CI
57+ except ImportError :
58+ # dotenv not available, skip loading
59+ pass
60+ except FileNotFoundError :
61+ # .env file may not exist in CI
62+ pass
5963
6064
6165def get_allow_origins ():
Original file line number Diff line number Diff line change @@ -16,8 +16,9 @@ def get_engine():
1616 from chroma_knowledge_search .backend .app .config import load_config
1717
1818 load_config ()
19- except Exception :
20- pass # Config loading may fail in tests
19+ except (ImportError , FileNotFoundError ):
20+ # Config loading may fail in tests or when files don't exist
21+ pass
2122
2223 db_url = os .getenv ("DB_URL" , "sqlite+aiosqlite:///:memory:" )
2324 _engine = create_async_engine (db_url , echo = False , future = True )
Original file line number Diff line number Diff line change @@ -57,5 +57,8 @@ async def health():
5757
5858if __name__ == "__main__" :
5959 import uvicorn
60+ import os
6061
61- uvicorn .run (app , host = "0.0.0.0" , port = 10000 )
62+ host = os .getenv ("HOST" , "127.0.0.1" )
63+ port = int (os .getenv ("PORT" , "8000" ))
64+ uvicorn .run (app , host = host , port = port )
You can’t perform that action at this time.
0 commit comments