From aa19e4363c82082b2412eec267fb27c4079f5da7 Mon Sep 17 00:00:00 2001 From: Bo-Yi Wu Date: Sat, 8 Jan 2022 15:01:10 +0800 Subject: [PATCH] fix: set another variable. Signed-off-by: Bo-Yi Wu --- manager.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/manager.go b/manager.go index 1246b6f..92d747c 100644 --- a/manager.go +++ b/manager.go @@ -45,8 +45,9 @@ func (g *Manager) doGracefulShutdown() { g.shutdownCtxCancel() // doing shutdown job for _, f := range g.runAtShutdown { + run := f g.runningWaitGroup.Run(func() { - g.doShutdownJob(f) + g.doShutdownJob(run) }) } go func() {