️ 删除不需要的 async

This commit is contained in:
2024-08-15 16:50:11 +08:00
parent 63cd94a0d7
commit 6042417b65
2 changed files with 3 additions and 3 deletions

View File

@@ -55,7 +55,7 @@ def _():
@app.get('/host/{page_hash}.html', status_code=status.HTTP_200_OK)
async def _(page_hash: str) -> HTMLResponse:
def _(page_hash: str) -> HTMLResponse:
if page_hash in HostPage.pages:
return HTMLResponse(HostPage.pages[page_hash])
return NOT_FOUND

View File

@@ -56,7 +56,7 @@ async def download_templates(tag: str) -> Path:
return path
async def unzip_templates(zip_path: Path) -> Path:
def unzip_templates(zip_path: Path) -> Path:
logger.info('开始解压模板')
temp_path = TEMPLATES_DIR.parent / f'temp_{time_ns()}'
with ZipFile(zip_path) as zip_file:
@@ -91,7 +91,7 @@ async def check_hash(hash_file_path: Path) -> bool:
async def init_templates(tag: str) -> bool:
logger.info(f'开始初始化模板 {tag}')
temp_path = await unzip_templates(await download_templates(tag))
temp_path = unzip_templates(await download_templates(tag))
if not await check_hash(temp_path / 'hash.sha256'):
rmtree(temp_path)
return False