Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENH: 一部の関数をasync defに変更 #1134

Merged
merged 3 commits into from
Mar 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions run.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ async def block_origin_middleware(
)

# 許可されていないAPIを無効化する
def check_disabled_mutable_api() -> None:
async def check_disabled_mutable_api() -> None:
if disable_mutable_api:
raise HTTPException(
status_code=403,
Expand Down Expand Up @@ -837,11 +837,11 @@ def delete_preset(
return Response(status_code=204)

@app.get("/version", tags=["その他"])
def version() -> str:
async def version() -> str:
return __version__

@app.get("/core_versions", response_model=list[str], tags=["その他"])
def core_versions() -> Response:
async def core_versions() -> Response:
return Response(
content=json.dumps(list(cores.keys())),
media_type="application/json",
Expand Down Expand Up @@ -1276,7 +1276,7 @@ def supported_devices(
)

@app.get("/engine_manifest", response_model=EngineManifest, tags=["その他"])
def engine_manifest() -> EngineManifest:
async def engine_manifest() -> EngineManifest:
return engine_manifest_data

@app.post(
Expand All @@ -1291,7 +1291,7 @@ def engine_manifest() -> EngineManifest:
}
},
)
def validate_kana(
async def validate_kana(
text: Annotated[str, Query(description="判定する対象の文字列")]
) -> bool:
"""
Expand Down
Loading