fix: исправить загрузку вложений через async-поток Starlette

Co-authored-by: aider (deepseek/deepseek-chat) <aider@aider.chat>
This commit is contained in:
Evgeny Bushkov
2026-11-06 16:57:18 +03:00
co-authored by aider
parent d4a73152e4
commit 0d58963bc3
3 changed files with 33 additions and 17 deletions
+2 -2
View File
@@ -67,8 +67,8 @@ async def upload_attachment(
if declared not in ("image/png", "image/jpeg"):
raise ApiError(415, "unsupported_media_type", "Ожидается image/png или image/jpeg")
# Читаем тело потоково с жёстким лимитом.
data, sha, actual = s3.read_upload(request.stream(), declared)
# Читаем тело потоково с жёстким лимитом (async-итератор Starlette).
data, sha, actual = await s3.read_upload(request.stream(), declared)
att_id = uuid.uuid4()
key = s3.new_object_key(str(cid), str(att_id))