aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--service/app_runner.go23
1 files changed, 11 insertions, 12 deletions
diff --git a/service/app_runner.go b/service/app_runner.go
index 9d281cf..3d30571 100644
--- a/service/app_runner.go
+++ b/service/app_runner.go
@@ -116,19 +116,18 @@ func (r *AppRunner) RunForever(enableBg bool) {
116 // go run background if enabled 116 // go run background if enabled
117 select { 117 select {
118 case <-r.ctx.Done(): 118 case <-r.ctx.Done():
119 r.Logger.Info("Waiting for jobs to terminate") 119 goto done
120 r.wg.Wait()
121
122 r.Logger.Info("Shutdown completed")
123 return
124 case <-r.sigs: 120 case <-r.sigs:
125 r.Logger.Info("Shutting down main app context") 121 goto done
126 r.ctxCancel() 122 }
127 123
128 r.Logger.Info("Waiting for jobs to terminate") 124done:
129 r.wg.Wait() 125 r.Logger.Info("Shutting down main app context")
126 r.ctxCancel()
130 127
131 r.Logger.Info("Shutdown completed") 128 r.Logger.Info("Waiting for jobs to terminate")
132 return 129 r.wg.Wait()
133 } 130
131 r.Logger.Info("Shutdown completed")
132 return
134} 133}