mirror of
https://github.com/christianselig/apollo-backend
synced 2024-11-13 23:47:44 +00:00
use conn poll url first
This commit is contained in:
parent
9925ce7eb6
commit
06b80b9714
2 changed files with 12 additions and 2 deletions
|
@ -35,7 +35,12 @@ func main() {
|
||||||
|
|
||||||
var cfg config
|
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 {
|
if err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|
|
@ -124,7 +124,12 @@ func main() {
|
||||||
|
|
||||||
rc := reddit.NewClient(os.Getenv("REDDIT_CLIENT_ID"), os.Getenv("REDDIT_CLIENT_SECRET"))
|
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 {
|
if err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue