Loading src/context/service/__main__.py +10 −2 Original line number Diff line number Diff line Loading @@ -44,9 +44,17 @@ def main(): start_http_server(metrics_port) # Get Database Engine instance and initialize database, if needed LOGGER.info('Getting SQLAlchemy DB Engine...') db_engine = Engine.get_engine() if db_engine is None: return -1 if db_engine is None: LOGGER.error('Unable to get SQLAlchemy DB Engine...') return -1 try: Engine.create_database(db_engine) except: # pylint: disable=bare-except # pragma: no cover LOGGER.exception('Failed to check/create the database: {:s}'.format(str(db_engine.url))) rebuild_database(db_engine) # Get message broker instance Loading src/context/service/database/Engine.py +0 −6 Original line number Diff line number Diff line Loading @@ -42,12 +42,6 @@ class Engine: LOGGER.exception('Failed to connect to database: {:s}'.format(str(crdb_uri))) return None try: Engine.create_database(engine) except: # pylint: disable=bare-except # pragma: no cover LOGGER.exception('Failed to check/create to database: {:s}'.format(str(crdb_uri))) return None return engine @staticmethod Loading Loading
src/context/service/__main__.py +10 −2 Original line number Diff line number Diff line Loading @@ -44,9 +44,17 @@ def main(): start_http_server(metrics_port) # Get Database Engine instance and initialize database, if needed LOGGER.info('Getting SQLAlchemy DB Engine...') db_engine = Engine.get_engine() if db_engine is None: return -1 if db_engine is None: LOGGER.error('Unable to get SQLAlchemy DB Engine...') return -1 try: Engine.create_database(db_engine) except: # pylint: disable=bare-except # pragma: no cover LOGGER.exception('Failed to check/create the database: {:s}'.format(str(db_engine.url))) rebuild_database(db_engine) # Get message broker instance Loading
src/context/service/database/Engine.py +0 −6 Original line number Diff line number Diff line Loading @@ -42,12 +42,6 @@ class Engine: LOGGER.exception('Failed to connect to database: {:s}'.format(str(crdb_uri))) return None try: Engine.create_database(engine) except: # pylint: disable=bare-except # pragma: no cover LOGGER.exception('Failed to check/create to database: {:s}'.format(str(crdb_uri))) return None return engine @staticmethod Loading