Skip to content

Commit

Permalink
ENH: 一部の関数をasync defに変更 (#1134)
Browse files Browse the repository at this point in the history
* ENH: 一部の関数を`async def`に変更

* FIX: CDLLにアクセスする関数を戻した
  • Loading branch information
sabonerune authored Mar 27, 2024
1 parent e2a531a commit f43881b
Showing 1 changed file with 5 additions and 5 deletions.
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

0 comments on commit f43881b

Please sign in to comment.