async def METHOD_NAME(self):
    logger.info("Shutting down")
    logger.info("Waiting for application shutdown.")
    try:
        await self._lifespan.shutdown()
    except Exception as e:
        logger.opt(colors=True, exception=e).error(
            "<r><bg #f8bbd0>Error when running shutdown function. "
            "Ignored!</bg #f8bbd0></r>"
        )
    for task in asyncio.all_tasks():
        if task is not asyncio.current_task() and not task.done():
            task.cancel()
    await asyncio.sleep(0.1)
    tasks = [t for t in asyncio.all_tasks() if t is not asyncio.current_task()]
    if tasks and not self.force_exit:
        logger.info("Waiting for tasks to finish. (CTRL+C to force quit)")
    while tasks and not self.force_exit:
        await asyncio.sleep(0.1)
        tasks = [t for t in asyncio.all_tasks() if t is not asyncio.current_task()]
    for task in tasks:
        task.cancel()
    await asyncio.gather(*tasks, return_exceptions=True)
    logger.info("Application shutdown complete.")
    loop = asyncio.get_event_loop()
    loop.stop()