mirror of
https://github.com/arc53/DocsGPT.git
synced 2025-11-29 08:33:20 +00:00
fix: add error handling for index creation in user and agents collections
This commit is contained in:
@@ -62,12 +62,15 @@ user_logs_collection = db["user_logs"]
|
|||||||
user_tools_collection = db["user_tools"]
|
user_tools_collection = db["user_tools"]
|
||||||
attachments_collection = db["attachments"]
|
attachments_collection = db["attachments"]
|
||||||
|
|
||||||
agents_collection.create_index(
|
try:
|
||||||
[("shared", 1)],
|
agents_collection.create_index(
|
||||||
name="shared_index",
|
[("shared_publicly", 1)],
|
||||||
background=True,
|
name="shared_index",
|
||||||
)
|
background=True,
|
||||||
users_collection.create_index("user_id", unique=True)
|
)
|
||||||
|
users_collection.create_index("user_id", unique=True)
|
||||||
|
except Exception as e:
|
||||||
|
current_app.logger.warning(f"Can't create indexes: {e}", )
|
||||||
|
|
||||||
user = Blueprint("user", __name__)
|
user = Blueprint("user", __name__)
|
||||||
user_ns = Namespace("user", description="User related operations", path="/")
|
user_ns = Namespace("user", description="User related operations", path="/")
|
||||||
|
|||||||
Reference in New Issue
Block a user