aiteamutils 0.2.54__tar.gz → 0.2.56__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: aiteamutils
3
- Version: 0.2.54
3
+ Version: 0.2.56
4
4
  Summary: AI Team Utilities
5
5
  Project-URL: Homepage, https://github.com/yourusername/aiteamutils
6
6
  Project-URL: Issues, https://github.com/yourusername/aiteamutils/issues
@@ -1,11 +1,5 @@
1
1
  from .base_model import Base
2
- from .database import (
3
- DatabaseService,
4
- DatabaseServiceManager,
5
- get_db,
6
- get_database_service,
7
- lifespan
8
- )
2
+ from .database import DatabaseService
9
3
  from .exceptions import (
10
4
  CustomException,
11
5
  ErrorCode,
@@ -36,10 +30,6 @@ __all__ = [
36
30
 
37
31
  # Database
38
32
  "DatabaseService",
39
- "DatabaseServiceManager",
40
- "get_db",
41
- "get_database_service",
42
- "lifespan",
43
33
 
44
34
  # Exceptions
45
35
  "CustomException",
@@ -1,6 +1,5 @@
1
1
  """설정 모듈."""
2
2
  from typing import Union
3
- from .database import DatabaseServiceManager
4
3
  from .exceptions import CustomException, ErrorCode
5
4
 
6
5
  class Settings:
@@ -11,13 +10,28 @@ class Settings:
11
10
  jwt_algorithm: str = "HS256",
12
11
  access_token_expire_minutes: int = 30,
13
12
  token_issuer: str = "ai-team",
14
- token_audience: str = "ai-team"
13
+ token_audience: str = "ai-team",
14
+ db_url: str = None,
15
+ db_echo: bool = False,
16
+ db_pool_size: int = 5,
17
+ db_max_overflow: int = 10,
18
+ db_pool_timeout: int = 30,
19
+ db_pool_recycle: int = 1800
15
20
  ):
21
+ # JWT 설정
16
22
  self.JWT_SECRET = jwt_secret
17
23
  self.JWT_ALGORITHM = jwt_algorithm
18
24
  self.ACCESS_TOKEN_EXPIRE_MINUTES = access_token_expire_minutes
19
25
  self.TOKEN_ISSUER = token_issuer
20
26
  self.TOKEN_AUDIENCE = token_audience
27
+
28
+ # 데이터베이스 설정
29
+ self.DB_URL = db_url
30
+ self.DB_ECHO = db_echo
31
+ self.DB_POOL_SIZE = db_pool_size
32
+ self.DB_MAX_OVERFLOW = db_max_overflow
33
+ self.DB_POOL_TIMEOUT = db_pool_timeout
34
+ self.DB_POOL_RECYCLE = db_pool_recycle
21
35
 
22
36
  _settings: Union[Settings, None] = None
23
37
 
@@ -55,18 +69,14 @@ async def init_settings(
55
69
  jwt_algorithm=jwt_algorithm,
56
70
  access_token_expire_minutes=access_token_expire_minutes,
57
71
  token_issuer=token_issuer,
58
- token_audience=token_audience
72
+ token_audience=token_audience,
73
+ db_url=db_url,
74
+ db_echo=db_echo,
75
+ db_pool_size=db_pool_size,
76
+ db_max_overflow=db_max_overflow,
77
+ db_pool_timeout=db_pool_timeout,
78
+ db_pool_recycle=db_pool_recycle
59
79
  )
60
-
61
- if db_url:
62
- await DatabaseServiceManager.get_instance(
63
- db_url=db_url,
64
- db_echo=db_echo,
65
- db_pool_size=db_pool_size,
66
- db_max_overflow=db_max_overflow,
67
- db_pool_timeout=db_pool_timeout,
68
- db_pool_recycle=db_pool_recycle
69
- )
70
80
 
71
81
  def get_settings() -> Settings:
72
82
  """현재 설정을 반환하는 함수
@@ -0,0 +1,2 @@
1
+ """버전 정보"""
2
+ __version__ = "0.2.56"
@@ -1,2 +0,0 @@
1
- """버전 정보"""
2
- __version__ = "0.2.54"
File without changes
File without changes
File without changes
File without changes