1.添加定时任务(每天凌晨四点处理redis记录的删除,存储入mysql持久化操作)
2.修复了prompt中没有用户输入信息的bug 3.优化了更新类接口代码(删除了db.add()代码)
This commit is contained in:
1 parent
de370f77ac
commit
065528f509
7 files changed
+65
-16
No files matched your search
@@ -35,7 +35,6 @@ async def update_user_handler(user_id:int, user:UserUpdateRequest, db: Session):
|
||||
existing_user.tags = user.tags
|
||||
existing_user.persona = user.persona
|
||||
try:
|
||||
db.add(existing_user)
|
||||
db.commit()
|
||||
db.refresh(existing_user)
|
||||
except Exception as e:
|
||||
@@ -117,7 +116,6 @@ async def change_bind_hardware_handler(hardware_id, user, db):
|
||||
if existing_hardware is None:
|
||||
raise HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail="硬件不存在")
|
||||
existing_hardware.user_id = user.user_id
|
||||
db.add(existing_hardware)
|
||||
db.commit()
|
||||
db.refresh(existing_hardware)
|
||||
except Exception as e:
|
||||
@@ -136,7 +134,6 @@ async def update_hardware_handler(hardware_id, hardware, db):
|
||||
existing_hardware.mac = hardware.mac
|
||||
existing_hardware.firmware = hardware.firmware
|
||||
existing_hardware.model = hardware.model
|
||||
db.add(existing_hardware)
|
||||
db.commit()
|
||||
db.refresh(existing_hardware)
|
||||
except Exception as e:
|
||||
|
||||
Reference in new issue
Block a user