Don't assume app has configured a tempmon DB engine

whoops
This commit is contained in:
Lance Edgar 2018-11-29 14:52:44 -06:00
parent c1eaf28812
commit 6022ef9be3

View file

@ -63,8 +63,9 @@ def make_rattail_config(settings):
# configure database sessions # configure database sessions
tailbone.db.Session.configure(bind=rattail_config.rattail_engine) tailbone.db.Session.configure(bind=rattail_config.rattail_engine)
tailbone.db.TempmonSession.configure(bind=rattail_config.tempmon_engine)
tailbone.db.TrainwreckSession.configure(bind=rattail_config.trainwreck_engine) tailbone.db.TrainwreckSession.configure(bind=rattail_config.trainwreck_engine)
if hasattr(rattail_config, 'tempmon_engine'):
tailbone.db.TempmonSession.configure(bind=rattail_config.tempmon_engine)
# Make sure rattail config object uses our scoped session, to avoid # Make sure rattail config object uses our scoped session, to avoid
# unnecessary connections (and pooling limits). # unnecessary connections (and pooling limits).