Skip to content

Commit 11b6155

Browse files
committed
fix: ensure unix socket shutdown doesn't run twice
1 parent e739aa8 commit 11b6155

2 files changed

Lines changed: 106 additions & 2 deletions

File tree

internal/bootstrap/app_bootstrap.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -356,8 +356,6 @@ func (app *BootstrapApp) serveUnix() error {
356356
os.Remove(app.config.Server.SocketPath)
357357
}
358358

359-
defer shutdown()
360-
361359
go func() {
362360
<-app.ctx.Done()
363361
app.log.App.Debug().Msg("Shutting down unix socket listener")
@@ -367,6 +365,7 @@ func (app *BootstrapApp) serveUnix() error {
367365
err = server.Serve(listener)
368366

369367
if err != nil && !errors.Is(err, http.ErrServerClosed) {
368+
shutdown()
370369
return fmt.Errorf("failed to start unix socket listener: %w", err)
371370
}
372371

lint.html

Lines changed: 105 additions & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)