Retry learning database connection on startup
Some checks failed
CI / test (push) Failing after 22s
Build and Deploy / build-and-deploy (push) Successful in 28s

This commit is contained in:
Grendgi
2026-06-12 16:26:24 +03:00
parent 89abcc1718
commit 5776c00dce

View File

@@ -32,7 +32,7 @@ func main() {
ctx, stop := signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM) ctx, stop := signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM)
defer stop() defer stop()
pool, err := commondb.ConnectURL(cfg.DatabaseURL) pool, err := commondb.ConnectWithRetry(ctx, cfg.DatabaseURL, 2*time.Minute)
if err != nil { if err != nil {
slog.Error("connect database", "error", err) slog.Error("connect database", "error", err)
os.Exit(1) os.Exit(1)