From 979d8d648da79e7ad41cc1c8840ff3b7f436dbd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=90=E4=BA=91=E9=87=91YunjinXu?= Date: Thu, 8 Jan 2026 10:37:36 +0800 Subject: [PATCH] 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 --- dtmsvr/api.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dtmsvr/api.go b/dtmsvr/api.go index fb9b09b..a2366c2 100644 --- a/dtmsvr/api.go +++ b/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) }