提交 8a30d25a 编写于 作者: a303176530's avatar a303176530

断点续传添加事务回滚

上级 9905a939
......@@ -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,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册