From da418fd3d583ef3cf0a49e22b566b1ac020beb12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=94=9C=E7=93=9C?= <42953016+tyut22316@users.noreply.github.com> Date: Sun, 23 Apr 2023 12:49:31 +0800 Subject: [PATCH] fix: incorrect number of wg.add (#203) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The work-group numbers is unequal to number of go routines spin-up by main function. It's a bug that affects the graceful shutdown. This commit fixed the number of work-group being added. Signed-off-by: 甜瓜 <42953016+tyut22316@users.noreply.github.com> --- main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.go b/main.go index 34cdcd5..e0971c2 100644 --- a/main.go +++ b/main.go @@ -475,7 +475,7 @@ func run() { _log.Infow("registered grpc health server") var wg sync.WaitGroup - wg.Add(5) + wg.Add(6) go runAPI(&wg, ctx) go runRPC(&wg, ctx)