diff --git a/cmd/anubis/main.go b/cmd/anubis/main.go index 9cade6a..9eb2f54 100644 --- a/cmd/anubis/main.go +++ b/cmd/anubis/main.go @@ -263,7 +263,10 @@ func main() { return } - ctx := context.Background() + // install signal handler + ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt, syscall.SIGTERM) + defer stop() + wg := new(sync.WaitGroup) if *metricsBind != "" { @@ -414,10 +417,6 @@ func main() { log.Fatalf("can't construct libanubis.Server: %v", err) } - // install signal handler - ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt, syscall.SIGTERM) - defer stop() - var h http.Handler h = s h = internal.RemoteXRealIP(*useRemoteAddress, *bindNetwork, h) diff --git a/docs/docs/CHANGELOG.md b/docs/docs/CHANGELOG.md index a830548..1d479a1 100644 --- a/docs/docs/CHANGELOG.md +++ b/docs/docs/CHANGELOG.md @@ -13,6 +13,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 +- Fix hanging on service restart ([#853](https://github.com/TecharoHQ/anubis/issues/853)) + ## v1.21.0: Minfilia Warde > Please, be at ease. You are among friends here.