add timeout to Ping check
continuous-integration/drone/push Build is passing Details

main
Drew Bednar 2 months ago
parent 663c957880
commit 62f9656e19

@ -72,7 +72,10 @@ func run(ctx context.Context, w io.Writer, args []string) error {
pool.Close()
}()
if err := pool.Ping(appCtx); err != nil {
timoutCtx, close := context.WithTimeout(appCtx, 5*time.Second)
defer close()
if err := pool.Ping(timoutCtx); err != nil {
slog.Error("Error in attempting first postgres database connection")
return err
}

Loading…
Cancel
Save