Merges initializeDB and initializeNimbus into init_nimbus_db, since updating db requires us to update nimbus, it felt like better practice to have them both updated in one method rather than have the confusion of calling init_db in init_nimbus and init_nimbus in init_db
Adds pre-ping by checking if the engine can connect, and re-initializing the db/nimbus client if we cannot
Fixes #145
Type of change (pick-one)
[x] Bug fix (non-breaking change which fixes an issue)
[ ] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
[ ] This change requires a documentation update
How Has This Been Tested?
Tried setting the wait_timeout variable of the db connection to 5 seconds (timeout after 5 seconds). The screencap below shows a query successfully running in the 5 seconds that the connection is active, and the query failing but restarting the connection and eventually succeeding even after the connection times out.
Tests still pass!
Checklist (check-all-before-merge)
formatting help: - [x] means "checked' and - [ ] means "unchecked"
What's New?
initializeDB
andinitializeNimbus
intoinit_nimbus_db
, since updatingdb
requires us to updatenimbus
, it felt like better practice to have them both updated in one method rather than have the confusion of callinginit_db
ininit_nimbus
andinit_nimbus
ininit_db
Fixes #145
Type of change (pick-one)
How Has This Been Tested?
Tried setting the
wait_timeout
variable of the db connection to 5 seconds (timeout after 5 seconds). The screencap below shows a query successfully running in the 5 seconds that the connection is active, and the query failing but restarting the connection and eventually succeeding even after the connection times out.Tests still pass!
Checklist (check-all-before-merge)
formatting help:
- [x]
means "checked' and- [ ]
means "unchecked"[ ] I documented my code according to the Google Python Style Guide
[ ] I ran
./build_docs.sh
and the docs look fine[ ] I ran
./type_check.sh
and got no errors[ ] I ran
./format.sh
because it automatically cleans my code for me 😄[ ] I ran
./lint.sh
to check for what "format" missed[ ] I added my tests to the
/tests
directory[x] I ran
./run_tests.sh
and all the tests pass