-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
26 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,23 @@ | ||
from functools import lru_cache | ||
from typing import Annotated | ||
|
||
from fastapi import Depends | ||
|
||
from .services.member import MemberService | ||
from .services.video import VideoService | ||
from .settings import Settings | ||
|
||
|
||
@lru_cache | ||
def get_settings() -> Settings: | ||
print("Loading settings") | ||
def get_settings(): | ||
return Settings() | ||
|
||
|
||
@lru_cache | ||
def get_member_service() -> MemberService: | ||
def get_member_service(settings: Annotated[Settings, Depends(get_settings)]): | ||
"""Get the member service.""" | ||
print("Loading member service") | ||
return MemberService(get_settings().server_base_path) | ||
return MemberService(settings.server_base_path) | ||
|
||
|
||
@lru_cache | ||
def get_video_service() -> VideoService: | ||
def get_video_service(settings: Annotated[Settings, Depends(get_settings)]): | ||
"""Get the video service.""" | ||
print("Loading video service") | ||
return VideoService(get_settings().server_base_path) | ||
return VideoService(settings.server_base_path) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters