Retry learning database connection on startup
This commit is contained in:
@@ -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)
|
||||||
|
|||||||
Reference in New Issue
Block a user