diff --git a/cmd/apollo-api/main.go b/cmd/apollo-api/main.go index c4f8b05..b6bbcb0 100644 --- a/cmd/apollo-api/main.go +++ b/cmd/apollo-api/main.go @@ -35,7 +35,12 @@ func main() { var cfg config - db, err := sql.Open("postgres", os.Getenv("DATABASE_URL")) + dburl, ok := os.LookupEnv("DATABASE_CONNECTION_POOL_URL") + if !ok { + dburl = os.Getenv("DATABASE_URL") + } + + db, err := sql.Open("postgres", dburl) if err != nil { log.Fatal(err) } diff --git a/cmd/apollo-worker/main.go b/cmd/apollo-worker/main.go index 03088c3..4e7a041 100644 --- a/cmd/apollo-worker/main.go +++ b/cmd/apollo-worker/main.go @@ -124,7 +124,12 @@ func main() { rc := reddit.NewClient(os.Getenv("REDDIT_CLIENT_ID"), os.Getenv("REDDIT_CLIENT_SECRET")) - db, err := sql.Open("postgres", os.Getenv("DATABASE_URL")) + dburl, ok := os.LookupEnv("DATABASE_CONNECTION_POOL_URL") + if !ok { + dburl = os.Getenv("DATABASE_URL") + } + + db, err := sql.Open("postgres", dburl) if err != nil { log.Fatal(err) }