Spaces:
Runtime error
Runtime error
Commit
·
df0cb26
1
Parent(s):
3e7b272
new update
Browse files- db/mongoDB.py +1 -1
- db/weaviateDB.py +1 -1
- main.py +1 -1
db/mongoDB.py
CHANGED
|
@@ -43,7 +43,7 @@ async def connect_to_mongo():
|
|
| 43 |
# 1. Khởi tạo client bất đồng bộ
|
| 44 |
mongo_db.client = AsyncIOMotorClient(
|
| 45 |
config.MONGO_URI,
|
| 46 |
-
serverSelectionTimeoutMS=
|
| 47 |
)
|
| 48 |
|
| 49 |
# 2. Kiểm tra kết nối một cách rõ ràng
|
|
|
|
| 43 |
# 1. Khởi tạo client bất đồng bộ
|
| 44 |
mongo_db.client = AsyncIOMotorClient(
|
| 45 |
config.MONGO_URI,
|
| 46 |
+
serverSelectionTimeoutMS=30000 # Thời gian chờ kết nối là 5 giây
|
| 47 |
)
|
| 48 |
|
| 49 |
# 2. Kiểm tra kết nối một cách rõ ràng
|
db/weaviateDB.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
import weaviate
|
| 2 |
-
from weaviate.connect import ConnectionParams
|
| 3 |
from weaviate import WeaviateClient
|
|
|
|
| 4 |
from weaviate.classes.init import Auth
|
| 5 |
import logging
|
| 6 |
import config
|
|
|
|
| 1 |
import weaviate
|
|
|
|
| 2 |
from weaviate import WeaviateClient
|
| 3 |
+
from weaviate.connect import ConnectionParams
|
| 4 |
from weaviate.classes.init import Auth
|
| 5 |
import logging
|
| 6 |
import config
|
main.py
CHANGED
|
@@ -99,6 +99,6 @@ if __name__ == "__main__":
|
|
| 99 |
host=config.API_HOST if hasattr(config, 'API_HOST') else "0.0.0.0",
|
| 100 |
port=int(config.API_PORT) if hasattr(config, 'API_PORT') else 5000,
|
| 101 |
reload=True, # reload=True chỉ nên dùng cho development
|
| 102 |
-
timeout_keep_alive=
|
| 103 |
log_level="info" # Hoặc "debug" nếu bạn muốn nhiều thông tin hơn
|
| 104 |
)
|
|
|
|
| 99 |
host=config.API_HOST if hasattr(config, 'API_HOST') else "0.0.0.0",
|
| 100 |
port=int(config.API_PORT) if hasattr(config, 'API_PORT') else 5000,
|
| 101 |
reload=True, # reload=True chỉ nên dùng cho development
|
| 102 |
+
timeout_keep_alive=180, # Tăng thời gian giữ kết nối
|
| 103 |
log_level="info" # Hoặc "debug" nếu bạn muốn nhiều thông tin hơn
|
| 104 |
)
|