Browse Source

fix CompensateErrorBranch

alpha
yedf2 4 years ago
parent
commit
15c96e52de
  1. 3
      dtmgrpc/workflow/imp.go

3
dtmgrpc/workflow/imp.go

@ -160,9 +160,10 @@ func (wf *Workflow) callPhase2(branchID string, fn WfPhase2Func) error {
func (wf *Workflow) recordedDo(fn func(bb *dtmcli.BranchBarrier) *stepResult) *stepResult {
sr := wf.recordedDoInner(fn)
// if options not enabled, only successful branch need to be compensated
if !wf.Options.CompensateErrorBranch && wf.currentRollbackItem != nil && sr.Status == dtmcli.ResultSuccess {
if !wf.Options.CompensateErrorBranch && wf.currentRollbackItem != nil && sr.Status == dtmcli.StatusSucceed {
wf.failedOps = append(wf.failedOps, *wf.currentRollbackItem)
}
wf.currentRollbackItem = nil
return sr
}

Loading…
Cancel
Save