def main(): config = get_config('./config.ini') try: application.run(host=config['MIDDLEWARE']['host'], port=config['MIDDLEWARE']['port'], debug=config['MIDDLEWARE']['debug']) except Exception as e: logging.exception("Excecption fell through all catches. Closing loop.") loop.close() raise SystemExit
async def get_connection(): config = get_config() conn = await asyncpg.connect( # TODO: can become configurables in the future host='127.0.0.1', port=5432, user=config['DB']['user'], password=config['DB']['password'], database=config['DB']['dbname']) # destroy authentication info ASAP del config return conn
def setUp(self): self._config = get_config()