Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check DB connection when the application start #78

Open
tejash-jl opened this issue Nov 10, 2020 · 3 comments
Open

Check DB connection when the application start #78

tejash-jl opened this issue Nov 10, 2020 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@tejash-jl
Copy link
Member

Describe the bug
Currently, the application starts without the knowledge of the DB connection. If the downstream DB is down, we get to know only when we hit the API.

To Reproduce

  1. Start the application with a wrong DB connection
  2. Application starts
  3. Call any API, fails with DB connection is not available.

Expected behavior
The application should not start if the DB connection is not possible.

Screenshots/Logs
dial tcp [::1]:5432: connect: connection refused

@tejash-jl tejash-jl added the bug Something isn't working label Nov 10, 2020
@tejash-jl tejash-jl self-assigned this Nov 12, 2020
@sivachandran
Copy link
Contributor

@tejash-jl are you working on this(asking as it is assigned to you)?

@tejash-jl
Copy link
Member Author

@sivachandran currently I'm not

@sivachandran
Copy link
Contributor

Okay, thanks @tejash-jl. Let me take a shot at it.

I'm thinking of introducing Ping function to repository.DBInterface and call pg.DB.Ping from postgres.Ping. Let me know if you can think of a better way.

@priyaaank

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants