Update modules/database/database_init.py
Browse files
modules/database/database_init.py
CHANGED
@@ -47,6 +47,7 @@ def get_container(container_name):
|
|
47 |
"users": user_container is not None,
|
48 |
"users_sessions": user_sessions_container is not None,
|
49 |
"application_requests": application_requests_container is not None
|
|
|
50 |
}
|
51 |
|
52 |
logger.info(f"Estado actual de los contenedores: {containers_status}")
|
@@ -55,7 +56,8 @@ def get_container(container_name):
|
|
55 |
containers = {
|
56 |
"users": user_container,
|
57 |
"users_sessions": user_sessions_container,
|
58 |
-
"application_requests": application_requests_container
|
|
|
59 |
}
|
60 |
|
61 |
container = containers.get(container_name)
|
@@ -80,7 +82,8 @@ def initialize_cosmos_sql_connection():
|
|
80 |
user_database,
|
81 |
user_container,
|
82 |
user_sessions_container,
|
83 |
-
application_requests_container
|
|
|
84 |
]):
|
85 |
logger.debug("Todas las conexiones ya est谩n inicializadas")
|
86 |
return True
|
@@ -118,11 +121,20 @@ def initialize_cosmos_sql_connection():
|
|
118 |
logger.error(f"Error inicializando contenedor 'application_requests': {str(e)}")
|
119 |
application_requests_container = None
|
120 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
121 |
# Verificar el estado de los contenedores
|
122 |
containers_status = {
|
123 |
'users': user_container is not None,
|
124 |
'users_sessions': user_sessions_container is not None,
|
125 |
'application_requests': application_requests_container is not None
|
|
|
126 |
}
|
127 |
|
128 |
logger.info(f"Estado de los contenedores: {containers_status}")
|
|
|
47 |
"users": user_container is not None,
|
48 |
"users_sessions": user_sessions_container is not None,
|
49 |
"application_requests": application_requests_container is not None
|
50 |
+
"user_feedback": user_feedback_container is not None # A帽adido
|
51 |
}
|
52 |
|
53 |
logger.info(f"Estado actual de los contenedores: {containers_status}")
|
|
|
56 |
containers = {
|
57 |
"users": user_container,
|
58 |
"users_sessions": user_sessions_container,
|
59 |
+
"application_requests": application_requests_container,
|
60 |
+
"user_feedback": user_feedback_container # A帽adido
|
61 |
}
|
62 |
|
63 |
container = containers.get(container_name)
|
|
|
82 |
user_database,
|
83 |
user_container,
|
84 |
user_sessions_container,
|
85 |
+
application_requests_container,
|
86 |
+
user_feedback_container
|
87 |
]):
|
88 |
logger.debug("Todas las conexiones ya est谩n inicializadas")
|
89 |
return True
|
|
|
121 |
logger.error(f"Error inicializando contenedor 'application_requests': {str(e)}")
|
122 |
application_requests_container = None
|
123 |
|
124 |
+
# A帽adir inicializaci贸n del contenedor user_feedback
|
125 |
+
try:
|
126 |
+
user_feedback_container = user_database.get_container_client("user_feedback")
|
127 |
+
logger.info("Contenedor 'user_feedback' inicializado correctamente")
|
128 |
+
except Exception as e:
|
129 |
+
logger.error(f"Error inicializando contenedor 'user_feedback': {str(e)}")
|
130 |
+
user_feedback_container = None
|
131 |
+
|
132 |
# Verificar el estado de los contenedores
|
133 |
containers_status = {
|
134 |
'users': user_container is not None,
|
135 |
'users_sessions': user_sessions_container is not None,
|
136 |
'application_requests': application_requests_container is not None
|
137 |
+
'user_feedback': user_feedback_container is not None # A帽adido
|
138 |
}
|
139 |
|
140 |
logger.info(f"Estado de los contenedores: {containers_status}")
|