From 11b6155b9e8b1c2c6a20d599c23d8e0f4c14d163 Mon Sep 17 00:00:00 2001 From: Stavros Date: Sun, 10 May 2026 16:03:39 +0300 Subject: [PATCH] fix: ensure unix socket shutdown doesn't run twice --- internal/bootstrap/app_bootstrap.go | 3 +- lint.html | 105 ++++++++++++++++++++++++++++ 2 files changed, 106 insertions(+), 2 deletions(-) create mode 100644 lint.html diff --git a/internal/bootstrap/app_bootstrap.go b/internal/bootstrap/app_bootstrap.go index 8f9fdec0..3f491fa1 100644 --- a/internal/bootstrap/app_bootstrap.go +++ b/internal/bootstrap/app_bootstrap.go @@ -356,8 +356,6 @@ func (app *BootstrapApp) serveUnix() error { os.Remove(app.config.Server.SocketPath) } - defer shutdown() - go func() { <-app.ctx.Done() app.log.App.Debug().Msg("Shutting down unix socket listener") @@ -367,6 +365,7 @@ func (app *BootstrapApp) serveUnix() error { err = server.Serve(listener) if err != nil && !errors.Is(err, http.ErrServerClosed) { + shutdown() return fmt.Errorf("failed to start unix socket listener: %w", err) } diff --git a/lint.html b/lint.html new file mode 100644 index 00000000..f29902f4 --- /dev/null +++ b/lint.html @@ -0,0 +1,105 @@ + + + + + golangci-lint + + + + + + + + + + +
+
+
+
+
+ + + + \ No newline at end of file