diff --git a/application/api/user/routes.py b/application/api/user/routes.py index ca2c50eb..9bc8cd80 100644 --- a/application/api/user/routes.py +++ b/application/api/user/routes.py @@ -62,12 +62,15 @@ user_logs_collection = db["user_logs"] user_tools_collection = db["user_tools"] attachments_collection = db["attachments"] -agents_collection.create_index( - [("shared", 1)], - name="shared_index", - background=True, -) -users_collection.create_index("user_id", unique=True) +try: + agents_collection.create_index( + [("shared_publicly", 1)], + name="shared_index", + background=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_ns = Namespace("user", description="User related operations", path="/")