From 43fdf2e83a4dd52bc10677ddec28c8f2eadc152f Mon Sep 17 00:00:00 2001 From: Evstigneev Denis Date: Mon, 11 Mar 2024 16:25:44 +0300 Subject: [PATCH 1/2] update type for WaitGroup in server --- server/options.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/options.go b/server/options.go index 8499438b..a0a08d05 100644 --- a/server/options.go +++ b/server/options.go @@ -13,6 +13,7 @@ import ( "go.unistack.org/micro/v4/meter" "go.unistack.org/micro/v4/options" "go.unistack.org/micro/v4/register" + msync "go.unistack.org/micro/v4/sync" "go.unistack.org/micro/v4/tracer" "go.unistack.org/micro/v4/util/id" ) @@ -32,7 +33,7 @@ type Options struct { // Listener may be passed if already created Listener net.Listener // Wait group - Wait *sync.WaitGroup + Wait *msync.WaitGroup // TLSConfig specifies tls.Config for secure serving TLSConfig *tls.Config // Metadata holds the server metadata -- 2.45.2 From 87db21bc182394f385ae86a575c820632dbd0a3d Mon Sep 17 00:00:00 2001 From: Evstigneev Denis Date: Tue, 12 Mar 2024 10:59:18 +0300 Subject: [PATCH 2/2] update option Wait --- server/options.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/server/options.go b/server/options.go index a0a08d05..ca61d9d7 100644 --- a/server/options.go +++ b/server/options.go @@ -147,8 +147,11 @@ func Wait(wg *sync.WaitGroup) options.Option { if wg == nil { wg = new(sync.WaitGroup) } + + wrap := msync.WrapWaitGroup(wg) + return func(src interface{}) error { - return options.Set(src, wg, ".Wait") + return options.Set(src, wrap, ".Wait") } } -- 2.45.2