File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 6666OTEL = {
6767 'endpoint' : None
6868}
69+
70+ # Database Configuration
71+ DATABASE_AUTO_CREATE_INDEX = True
72+ DATABASE_NAME_PREFIX = ''
73+ DATABASES = {
74+ 'default' : {}
75+ }
76+
77+ # Cache Configuration
78+ CACHES = {
79+ 'default' : {},
80+ 'local' : {
81+ 'backend' : 'spaceone.core.cache.local_cache.LocalCache' ,
82+ 'max_size' : 128 ,
83+ 'ttl' : 300
84+ }
85+ }
Original file line number Diff line number Diff line change @@ -140,6 +140,10 @@ def connect(cls):
140140 else :
141141 del db_conf ['read_preference' ]
142142
143+ db_name : str = db_conf .get ('db' , '' )
144+ db_name_prefix = global_conf .get ('DATABASE_NAME_PREFIX' , '' )
145+ db_conf ['db' ] = f'{ db_name_prefix } { db_name } '
146+
143147 host : str = str (db_conf .get ('host' , '' )).strip ()
144148 if host .startswith ('mongodb+srv://' ):
145149 db_conf ['tlsCAFile' ] = certifi .where ()
You can’t perform that action at this time.
0 commit comments