File tree Expand file tree Collapse file tree 2 files changed +13
-7
lines changed Expand file tree Collapse file tree 2 files changed +13
-7
lines changed Original file line number Diff line number Diff line change @@ -36,7 +36,6 @@ async def lifespan(_app: FastAPI) -> AsyncIterator[None]:
3636 logger, and database before serving requests.
3737 """
3838 configuration .load_configuration (os .environ ["LIGHTSPEED_STACK_CONFIG_PATH" ])
39- logger .info ("Creating AsyncLlamaStackClient" )
4039 await AsyncLlamaStackClientHolder ().load (configuration .configuration .llama_stack )
4140 client = AsyncLlamaStackClientHolder ().get_client ()
4241 # check if the Llama Stack version is supported by the service
Original file line number Diff line number Diff line change 66import constants
77from authentication import jwk_token , k8s , noop , noop_with_token
88from authentication .interface import AuthInterface
9- from configuration import configuration
10-
11- configuration .load_configuration (os .environ ["LIGHTSPEED_STACK_CONFIG_PATH" ])
9+ from configuration import LogicError , configuration
1210
1311logger = logging .getLogger (__name__ )
1412
@@ -17,9 +15,18 @@ def get_auth_dependency(
1715 virtual_path : str = constants .DEFAULT_VIRTUAL_PATH ,
1816) -> AuthInterface :
1917 """Select the configured authentication dependency interface."""
20- module = configuration .authentication_configuration .module
21-
22- logger .info (
18+ try :
19+ module = configuration .authentication_configuration .module
20+ except LogicError :
21+ # Only load once if not already loaded
22+ config_path = os .getenv (
23+ "LIGHTSPEED_STACK_CONFIG_PATH" ,
24+ "tests/configuration/lightspeed-stack.yaml" ,
25+ )
26+ configuration .load_configuration (config_path )
27+ module = configuration .authentication_configuration .module
28+
29+ logger .debug (
2330 "Initializing authentication dependency: module='%s', virtual_path='%s'" ,
2431 module ,
2532 virtual_path ,
You can’t perform that action at this time.
0 commit comments