aiteamutils 0.2.27__tar.gz → 0.2.29__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {aiteamutils-0.2.27 → aiteamutils-0.2.29}/PKG-INFO +1 -1
- {aiteamutils-0.2.27 → aiteamutils-0.2.29}/aiteamutils/dependencies.py +13 -17
- aiteamutils-0.2.29/aiteamutils/version.py +2 -0
- aiteamutils-0.2.27/aiteamutils/version.py +0 -2
- {aiteamutils-0.2.27 → aiteamutils-0.2.29}/.gitignore +0 -0
- {aiteamutils-0.2.27 → aiteamutils-0.2.29}/README.md +0 -0
- {aiteamutils-0.2.27 → aiteamutils-0.2.29}/aiteamutils/__init__.py +0 -0
- {aiteamutils-0.2.27 → aiteamutils-0.2.29}/aiteamutils/base_model.py +0 -0
- {aiteamutils-0.2.27 → aiteamutils-0.2.29}/aiteamutils/base_repository.py +0 -0
- {aiteamutils-0.2.27 → aiteamutils-0.2.29}/aiteamutils/base_service.py +0 -0
- {aiteamutils-0.2.27 → aiteamutils-0.2.29}/aiteamutils/cache.py +0 -0
- {aiteamutils-0.2.27 → aiteamutils-0.2.29}/aiteamutils/config.py +0 -0
- {aiteamutils-0.2.27 → aiteamutils-0.2.29}/aiteamutils/database.py +0 -0
- {aiteamutils-0.2.27 → aiteamutils-0.2.29}/aiteamutils/enums.py +0 -0
- {aiteamutils-0.2.27 → aiteamutils-0.2.29}/aiteamutils/exceptions.py +0 -0
- {aiteamutils-0.2.27 → aiteamutils-0.2.29}/aiteamutils/security.py +0 -0
- {aiteamutils-0.2.27 → aiteamutils-0.2.29}/aiteamutils/validators.py +0 -0
- {aiteamutils-0.2.27 → aiteamutils-0.2.29}/pyproject.toml +0 -0
- {aiteamutils-0.2.27 → aiteamutils-0.2.29}/setup.py +0 -0
@@ -53,26 +53,22 @@ service_registry = ServiceRegistry()
|
|
53
53
|
|
54
54
|
def get_service(name: str):
|
55
55
|
def _get_service(db: AsyncSession = Depends(get_db)):
|
56
|
-
# db 세션을 명시적으로 전달
|
57
56
|
db_service = get_database_service()
|
58
|
-
db_service.db = db
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
# 이미 생성된 서비스가 있다면 세션만 업데이트
|
63
|
-
if hasattr(service_registry, '_instances') and name in service_registry._instances:
|
64
|
-
service = service_registry._instances[name]
|
65
|
-
service.db_service.db = db
|
66
|
-
return service
|
67
|
-
|
68
|
-
repository = repository_class(db_service)
|
69
|
-
instance = service_class(repository, db_service)
|
70
|
-
|
57
|
+
db_service.db = db
|
58
|
+
|
59
|
+
# 서비스 인스턴스 초기화 보장
|
71
60
|
if not hasattr(service_registry, '_instances'):
|
72
61
|
service_registry._instances = {}
|
73
|
-
|
74
|
-
|
75
|
-
|
62
|
+
|
63
|
+
if name not in service_registry._instances:
|
64
|
+
repository_class, service_class = service_registry.get(name)
|
65
|
+
repository = repository_class(db_service)
|
66
|
+
service_registry._instances[name] = service_class(repository, db_service)
|
67
|
+
else:
|
68
|
+
# 기존 서비스의 db 세션 업데이트
|
69
|
+
service_registry._instances[name].db_service.db = db
|
70
|
+
|
71
|
+
return service_registry._instances[name]
|
76
72
|
return _get_service
|
77
73
|
|
78
74
|
oauth2_scheme = OAuth2PasswordBearer(tokenUrl="/users/token")
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|