Browse Source

断点续传添加事务回滚

main v2.2.0
QM303176530 4 years ago
parent
commit
8a30d25a06
  1. 4
      server/service/exa_simple_uploader.go

4
server/service/exa_simple_uploader.go

@ -55,6 +55,10 @@ func MergeFileMd5(md5 string, fileName string) (err error) {
//删除切片信息
err = tx.Delete(&model.ExaSimpleUploader{}, "identifier = ? AND is_done = ?", md5, false).Error
// 添加文件信息
if err != nil {
fmt.Println(err)
tx.Rollback()
}
err = tx.Create(&model.ExaSimpleUploader{
Identifier: md5,
IsDone: true,

Loading…
Cancel
Save