Browse Source

feat(dtmsvr): add delay consumption support for msg mode transactions

- Add logic to allow delaying consumption by using a custom NextCronTime
- In msg mode, return nil early when NextCronTime is set and after 3 seconds  from current time
pull/577/head
徐云金YunjinXu 3 months ago
parent
commit
979d8d648d
  1. 6
      dtmsvr/api.go

6
dtmsvr/api.go

@ -39,6 +39,12 @@ func svcSubmit(t *TransGlobal) interface{} {
} else if err != nil {
return err
}
// In msg mode, allow delaying consumption by using a custom NextCronTime
if !t.WaitResult && t.TransType == "msg" && !t.NextCronTime.IsZero() && t.NextCronTime.After(time.Now().Add(3*time.Second)) {
return nil
}
return t.Process(branches)
}

Loading…
Cancel
Save