thrimshim: Allow degraded operation even if DB broken

Any endpoints that don't need a DB conn will still work fine.

Notably, this includes /defaults, which is needed for
thrimbletrimmer to work in a non-specific-row mode.
pull/119/head
Mike Lang 5 years ago
parent 17af1c4e89
commit a42e7b48f6

@ -347,14 +347,7 @@ def main(connection_string, default_channel, bustime_start, host='0.0.0.0', port
sys.exit() sys.exit()
gevent.signal(signal.SIGTERM, stop) gevent.signal(signal.SIGTERM, stop)
app.db_manager = None
while app.db_manager is None and not stopping.is_set():
try:
app.db_manager = database.DBManager(dsn=connection_string) app.db_manager = database.DBManager(dsn=connection_string)
except Exception:
delay = common.jitter(10)
logging.info('Cannot connect to database. Retrying in {:.0f} s'.format(delay))
stopping.wait(delay)
common.PromLogCountsHandler.install() common.PromLogCountsHandler.install()
common.install_stacksampler() common.install_stacksampler()

Loading…
Cancel
Save