update tcc error check

This commit is contained in:
yedf2 2021-08-03 17:05:35 +08:00
parent 864ef5b4f7
commit 0df21c7c70

View File

@ -34,9 +34,8 @@ func TccGlobalTransaction(dtm string, gid string, tccFunc TccGlobalFunc) (rerr e
// 小概率情况下prepare成功了但是由于网络状况导致上面Failure那么不执行下面defer的内容等待超时后再回滚标记事务失败也没有问题
defer func() {
x := recover()
var err error
operation := common.If(x == nil && rerr == nil, "submit", "abort").(string)
err = tcc.CallDtm(data, operation)
err := tcc.CallDtm(data, operation)
if rerr == nil {
rerr = err
}