Skip to content

Commit

Permalink
Merge pull request #33 from evanebb/fix/db-conn-check
Browse files Browse the repository at this point in the history
Check if database is reachable during application startup
  • Loading branch information
evanebb authored Sep 7, 2023
2 parents ab37e5f + c2a977f commit ef9a54d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ func NewServer() (Server, error) {
return s, err
}

if err = db.Ping(context.Background()); err != nil {
return s, err
}

ar, err := postgres.NewApiUserRepository(db)
if err != nil {
return s, err
Expand Down

0 comments on commit ef9a54d

Please sign in to comment.