try: asyncio.get_event_loop().run_until_complete(func(**params)) except Exception as e: logging.warning(e) finally: exit(0)