Complete versioned attachment processing and fault invariants

This commit is contained in:
Artyom
2026-11-06 09:46:43 +03:00
parent e9e1ce576c
commit ac6c55809f
19 changed files with 474 additions and 46 deletions
+5 -2
View File
@@ -12,6 +12,7 @@ from messenger.attachments.application.commands import (
PublishOutbox,
RecoverExpiredLeases,
ReplayAttachment,
ReprocessAttachment,
SweepAbandonedUploads,
UploadAttachment,
)
@@ -26,6 +27,7 @@ from messenger.attachments.application.pipeline import (
PublishOutboxHandler,
RecoverExpiredLeasesHandler,
ReplayAttachmentHandler,
ReprocessAttachmentHandler,
)
from messenger.attachments.application.ports import (
AttachmentDirectory,
@@ -262,9 +264,10 @@ class AdminProvider(Provider):
@provide(scope=Scope.REQUEST)
def command_bus(
self, uow: AttachmentsUnitOfWork, publisher: EventPublisher
self, uow: AttachmentsUnitOfWork, publisher: EventPublisher, ids: IdGenerator, clock: Clock
) -> AttachmentsCommandBus:
handlers: dict[type[Command], CommandHandler] = {
ReplayAttachment: ReplayAttachmentHandler(uow)
ReplayAttachment: ReplayAttachmentHandler(uow),
ReprocessAttachment: ReprocessAttachmentHandler(uow, ids, clock),
}
return AttachmentsCommandBus(handlers, uow, publisher)