def _db_connect(): try: DB.connect() except OperationalError: LOGGER.exception("Error occured while connecting to database. %s", format_exc()) abort(503, "DB is not running")
def _db_close(exc): # pylint: disable=unused-argument if not DB.is_closed(): DB.close()
def _db_connect(): DB.connect()