From a42e7b48f635309eb942ad7c542da1fa683a6bc7 Mon Sep 17 00:00:00 2001 From: Mike Lang Date: Sun, 27 Oct 2019 01:23:05 -0700 Subject: [PATCH] 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. --- thrimshim/thrimshim/main.py | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/thrimshim/thrimshim/main.py b/thrimshim/thrimshim/main.py index cca218b..41d5b2f 100644 --- a/thrimshim/thrimshim/main.py +++ b/thrimshim/thrimshim/main.py @@ -347,14 +347,7 @@ def main(connection_string, default_channel, bustime_start, host='0.0.0.0', port sys.exit() 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) - except Exception: - delay = common.jitter(10) - logging.info('Cannot connect to database. Retrying in {:.0f} s'.format(delay)) - stopping.wait(delay) + app.db_manager = database.DBManager(dsn=connection_string) common.PromLogCountsHandler.install() common.install_stacksampler()