Update modules/database.py
Browse files- modules/database.py +16 -2
modules/database.py
CHANGED
|
@@ -32,8 +32,22 @@ chat_collection = None # Nueva variable global
|
|
| 32 |
|
| 33 |
#####################################################################################33
|
| 34 |
def initialize_database_connections():
|
| 35 |
-
|
| 36 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 37 |
return {
|
| 38 |
"mongodb": mongodb_success,
|
| 39 |
"cosmos_sql": sql_success
|
|
|
|
| 32 |
|
| 33 |
#####################################################################################33
|
| 34 |
def initialize_database_connections():
|
| 35 |
+
try:
|
| 36 |
+
print("Iniciando conexi贸n a MongoDB")
|
| 37 |
+
mongodb_success = initialize_mongodb_connection()
|
| 38 |
+
print(f"Conexi贸n a MongoDB: {'exitosa' if mongodb_success else 'fallida'}")
|
| 39 |
+
except Exception as e:
|
| 40 |
+
print(f"Error al conectar con MongoDB: {str(e)}")
|
| 41 |
+
mongodb_success = False
|
| 42 |
+
|
| 43 |
+
try:
|
| 44 |
+
print("Iniciando conexi贸n a Cosmos DB SQL API")
|
| 45 |
+
sql_success = initialize_cosmos_sql_connection()
|
| 46 |
+
print(f"Conexi贸n a Cosmos DB SQL API: {'exitosa' if sql_success else 'fallida'}")
|
| 47 |
+
except Exception as e:
|
| 48 |
+
print(f"Error al conectar con Cosmos DB SQL API: {str(e)}")
|
| 49 |
+
sql_success = False
|
| 50 |
+
|
| 51 |
return {
|
| 52 |
"mongodb": mongodb_success,
|
| 53 |
"cosmos_sql": sql_success
|