Customize attachment processing
Use WorkerAdapter
’s streamAttachments
function to handle attachment processing during the attachments extraction phase of an Airdrop import.
By default, it processes items from the attachments repo, which contains the URLs to stream the attachments.
Specify the batchSize
parameter to control how many attachments are processed simultaneously.
The attachment processing logic resides in attachment-extraction.ts
.
Default processing
When no custom processing logic is specified, the default processing logic is used.
Customize processing
Sometimes custom logic is needed for attachment processing. For example, when attachment URLs have short expiration times and would expire before the sync reaches the attachments extraction phase.
In such cases, you can provide custom processors to the streamAttachments
function:
- reducer: Transforms attachments into the format you need (grouping, filtering, batching, etc.).
- iterator: Processes the transformed data and calls
adapter.processAttachment()
for each attachment.