Закрывать listener API, если сервер не стартовал после его открытия

This commit is contained in:
2026-11-05 14:41:26 +03:00
parent 8e8e567fef
commit 99216ef808
2 changed files with 29 additions and 4 deletions
+1
View File
@@ -64,6 +64,7 @@ func run(ctx context.Context, log *slog.Logger, cfg config.Config, alias string)
if err != nil {
return fmt.Errorf("listen on %s: %w", cfg.Addr(), err)
}
defer ln.Close()
log.Info("starting", "env", cfg.Env, "addr", cfg.Addr(),
"gomaxprocs", runtime.GOMAXPROCS(0), "db_max_conns", cfg.DBMaxConns,
"drain_delay", cfg.DrainDelay.String(), "shutdown_timeout", cfg.ShutdownTimeout.String(),