Skip to content

Commit

Permalink
fix 删除历史记录文件处理
Browse files Browse the repository at this point in the history
  • Loading branch information
jxxghp committed Oct 19, 2024
1 parent c2d3a00 commit afd0edf
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions app/api/endpoints/history.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,11 @@ def delete_transfer_history(history_in: schemas.TransferHistory,
if not state:
return schemas.Response(success=False, msg=f"{dest_fileitem.path}删除失败")
# 删除源文件
if deletesrc and history.dest_fileitem:
dest_fileitem = schemas.FileItem(**history.dest_fileitem)
state = StorageChain().delete_file(dest_fileitem)
if deletesrc and history.src_fileitem:
src_fileitem = schemas.FileItem(**history.src_fileitem)
state = StorageChain().delete_file(src_fileitem)
if not state:
return schemas.Response(success=False, msg=f"{dest_fileitem.path}删除失败")
return schemas.Response(success=False, msg=f"{src_fileitem.path}删除失败")
# 发送事件
eventmanager.send_event(
EventType.DownloadFileDeleted,
Expand Down

0 comments on commit afd0edf

Please sign in to comment.