history 重构
This commit is contained in:
@@ -69,8 +69,23 @@ def desktop(user_uuid, course_id, chapter_name, lesson_name):
|
||||
|
||||
|
||||
|
||||
chatmanager = ChatManager(restart=not load_history)
|
||||
restart = not load_history
|
||||
chatmanager = ChatManager(restart=restart)
|
||||
current_app.extensions["user_uuid2chatmanager"][user_uuid] = chatmanager
|
||||
|
||||
# 如果restart为True,删除mongo中的学习进度
|
||||
if restart:
|
||||
try:
|
||||
mongo = current_app.extensions["mongo"]
|
||||
mongo.db.learning_progress.delete_one({
|
||||
"user_id": user_id,
|
||||
"material_id": course_id,
|
||||
"chapter_name": chapter_name,
|
||||
"lesson_name": lesson_name
|
||||
})
|
||||
current_app.logger.info(f"删除学习进度成功: user_id={user_id}, course_id={course_id}, chapter={chapter_name}, lesson={lesson_name}")
|
||||
except Exception as e:
|
||||
current_app.logger.error(f"删除学习进度失败: {str(e)}")
|
||||
code_server_port = 10000 + int(uuid.uuid4().int % 10000)
|
||||
# chatmanager.start_code_server(user_uuid, user_id, path_dir, code_server_port)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user