Page MenuHomePhabricator

Correct check_database_reachable() setup check
ClosedPublic

Authored by chris on Aug 11 2019, 3:27 PM.

Details

Summary

This corrects a bug in how I was checking for database connectivity on startup. For simplicity, I just changed from an array of connections to a single connection. Down the road when we build out database clustering this'll be something we need to revisit, but it's safe to ignore for now.

Test Plan
>>> import simplex
>>> from simplex.application.config import setup_check
>>> _tmp = setup_check.SimplexDatabaseSetupCheck(simplex.SIMPLEX_ENV)
>>> _tmp.issues
[]

Diff Detail

Repository
rSIM Simplex
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

chris requested review of this revision.Aug 11 2019, 3:27 PM
chris created this revision.
brooke accepted this revision.Aug 12 2019, 5:18 PM
brooke added inline comments.
simplex/infrastructure/storage/management/storage_management_api.py
68–69

this should be updated to

self.connection.close()

82

same as above...there is no self.conns anymore. The if else statement can be removed?

This revision is now accepted and ready to land.Aug 12 2019, 5:18 PM
brooke requested changes to this revision.Aug 12 2019, 5:18 PM
This revision now requires changes to proceed.Aug 12 2019, 5:18 PM
chris updated this revision to Diff 72.Aug 12 2019, 5:23 PM

Address review feedback

brooke accepted this revision.Aug 12 2019, 5:27 PM
This revision is now accepted and ready to land.Aug 12 2019, 5:27 PM
This revision was automatically updated to reflect the committed changes.