Skip to content
This repository has been archived by the owner on Mar 11, 2021. It is now read-only.

Commit

Permalink
Fix pq driver import
Browse files Browse the repository at this point in the history
  • Loading branch information
alexeykazakov committed Aug 15, 2018
1 parent fd9b111 commit 1bae716
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion configuration/configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,7 @@ func (c *ConfigurationData) setConfigDefaults() {
// prod-preview or prod
c.v.SetDefault(varEnvironment, "local")

c.v.SetDefault(varAuthKeysPath, "/token/keys")
c.v.SetDefault(varAuthKeysPath, "/api/token/keys")
}

// GetPostgresHost returns the postgres host as set via default, config file, or environment variable
Expand Down
5 changes: 4 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
"github.com/goadesign/goa/middleware/gzip"
"github.com/goadesign/goa/middleware/security/jwt"
"github.com/jinzhu/gorm"
_ "github.com/lib/pq"
"github.com/prometheus/client_golang/prometheus"
)

Expand Down Expand Up @@ -72,9 +73,11 @@ func main() {
for {
db, err = gorm.Open("postgres", config.GetPostgresConfigString())
if err != nil {
db.Close()
log.Logger().Errorf("ERROR: Unable to open connection to database %v", err)
log.Logger().Infof("Retrying to connect in %v...", config.GetPostgresConnectionRetrySleep())
if db != nil {
db.Close()
}
time.Sleep(config.GetPostgresConnectionRetrySleep())
} else {
defer db.Close()
Expand Down

0 comments on commit 1bae716

Please sign in to comment.