made async

This commit is contained in:
Kristian Krsnik 2024-04-12 17:11:27 +02:00
parent 90e9b9bb05
commit 34d6aa5a36
Signed by: Kristian
GPG Key ID: FD1330AC9F909E85
2 changed files with 2 additions and 2 deletions

View File

@ -44,7 +44,7 @@ class MinSizePerRequestError(Exception):
@api.get('/')
def test_data(api_key: str, request: Request, size: str) -> StreamingResponse:
async def test_data(api_key: str, request: Request, size: str) -> StreamingResponse:
try:
if api_key not in AUTHORIZED_KEYS:
raise HTTPException(

View File

@ -20,7 +20,7 @@ def convert_to_bytes(size: int | str) -> int:
raise ValueError
def generate_data(size: int, buffer_size: int = 4 * 1024) -> bytes:
async def generate_data(size: int, buffer_size: int = 4 * 1024) -> bytes:
size_left = size
while size_left > buffer_size: