Реализовать асинхронную обработку вложений

This commit is contained in:
2026-11-17 18:21:09 +03:00
parent 4d54ba3848
commit e8becaf761
51 changed files with 2234 additions and 58 deletions
+3 -3
View File
@@ -74,7 +74,7 @@ async def _load_attachments(
await session.execute(
select(
AttachmentRow.id,
AttachmentRow.object_key,
AttachmentRow.original_key,
AttachmentRow.status,
AttachmentRow.updated_at,
)
@@ -88,7 +88,7 @@ async def _metadata_key_exists(
) -> bool:
async with sessions() as session:
attachment_id = await session.scalar(
select(AttachmentRow.id).where(AttachmentRow.object_key == object_key).limit(1)
select(AttachmentRow.id).where(AttachmentRow.original_key == object_key).limit(1)
)
return attachment_id is not None
@@ -165,7 +165,7 @@ async def reconcile(
update(AttachmentRow)
.where(
AttachmentRow.id == attachment.id,
AttachmentRow.object_key == attachment.object_key,
AttachmentRow.original_key == attachment.object_key,
AttachmentRow.status == 'ready',
AttachmentRow.updated_at == attachment.updated_at,
)