INNER CODE UNIT · Python
lifespan
Marven11/EtherGhost · ether_ghost/main.py:80
async def lifespan(api: FastAPI):
# logger.warning("Your token is %s", token)
db.ensure_settings()
logger.warning("从此文件夹加载配置: %s", const.DATA_FOLDER.as_posix())
await session_connector.autostart_connectors()
yield
for _, filepath in temp_files.values():
if filepath.exists():
filepath.unlink()
temp_files.clear()
for tpl in tcp_forward_proxies.values():
server = tpl[-1]
try:
server.cancel()
except asyncio.exceptions.CancelledError: