lotus-provider-in-progress

This commit is contained in:
Andrew Jackson (Ajax)
2023-10-16 10:28:58 -05:00
parent 1f1e840e5c
commit e548b46dbf
8 changed files with 190 additions and 25 deletions
+4 -2
View File
@@ -201,9 +201,11 @@ var schemaRE = regexp.MustCompile(schemaREString)
func ensureSchemaExists(connString, schema string) error {
// FUTURE allow using fallback DBs for start-up.
p, err := pgx.Connect(context.Background(), connString)
ctx, cncl := context.WithDeadline(context.Background(), time.Now().Add(3*time.Second))
p, err := pgx.Connect(ctx, connString)
defer cncl()
if err != nil {
return err
return fmt.Errorf("unable to connect to db: %s, err: %v", connString, err)
}
defer func() { _ = p.Close(context.Background()) }()