From df96694e1015427322c8364ad65a92fdf9e5e83b Mon Sep 17 00:00:00 2001 From: eson <9673575+githubcontent@user.noreply.gitee.com> Date: Wed, 2 Aug 2023 19:05:23 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=B2=E9=86=9B=E5=BD=B1=E5=93=8D=E6=88=98?= =?UTF-8?q?=E6=96=97=E5=8A=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- command.go | 3 ++- main.go | 6 +----- start_test.go | 4 ++-- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/command.go b/command.go index 27bd976..0b27457 100644 --- a/command.go +++ b/command.go @@ -16,7 +16,8 @@ type CmdDequeue struct { } type Command struct { - Group string `json:"group"` + Group string `json:"group"` + Version string `json:"version"` } // func (cmd *Command) Encode() ([]byte, error) { diff --git a/main.go b/main.go index cecfc10..6357830 100644 --- a/main.go +++ b/main.go @@ -22,10 +22,6 @@ func main() { } -func init() { - -} - var Consumption = triggered.RegisterExecute(func(params *triggered.Params[bool]) { var nh *dragonboat.NodeHost @@ -60,7 +56,7 @@ var Consumption = triggered.RegisterExecute(func(params *triggered.Params[bool]) sysMB := float64(m.Sys) / 1024 / 1024 fmt.Printf("dequeue count %d, Alloc = %.2f MB, TotalAlloc = %.2f MB, Sys = %.2f MB\n", i, allocMB, totalAllocMB, sysMB) - time.Sleep(time.Second * 10) + time.Sleep(time.Second * 5) break } else { var item QueueItem diff --git a/start_test.go b/start_test.go index 44c40e6..33b0602 100644 --- a/start_test.go +++ b/start_test.go @@ -32,7 +32,7 @@ func TestStartNodeA(t *testing.T) { // this goroutine makes a linearizable read every 10 second. it returns the // Count value maintained in IStateMachine. see datastore.go for details. cs := nh.GetNoOPSession(128) - ticker := time.NewTicker(10 * time.Millisecond) + ticker := time.NewTicker(1 * time.Millisecond) for { select { case <-ticker.C: @@ -87,7 +87,7 @@ func TestStartNodeB(t *testing.T) { // Count value maintained in IStateMachine. see datastore.go for details. cs := nh.GetNoOPSession(128) - ticker := time.NewTicker(10 * time.Millisecond) + ticker := time.NewTicker(1 * time.Millisecond) for { select { case <-ticker.C: