From 76c17cde8730df2409930765d6f593e75a78e357 Mon Sep 17 00:00:00 2001 From: kenellorando Date: Wed, 1 Nov 2023 18:00:17 -0500 Subject: [PATCH] Extend initial db connect time --- cadence/server/db_postgres.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cadence/server/db_postgres.go b/cadence/server/db_postgres.go index ff8ebd4b..ca55c417 100644 --- a/cadence/server/db_postgres.go +++ b/cadence/server/db_postgres.go @@ -20,7 +20,8 @@ var dbp *sql.DB func postgresInit() (err error) { // We wait a bit to give some leeway for Postgres to finish startup. - time.Sleep(2 * time.Second) + // Obligatory: There's probably a better way to do this. + time.Sleep(5 * time.Second) dsn := fmt.Sprintf("host='%s' port='%s' user='%s' password='%s' sslmode='%s'", c.PostgresAddress, c.PostgresPort, c.PostgresUser, c.PostgresPassword, c.PostgresSSL) dbp, err = sql.Open("postgres", dsn)