perf: Read attachment buffers only when neccessary, closes #3849

This commit is contained in:
Tom Moor
2022-07-24 19:15:34 +01:00
parent 71da57773e
commit 5e852170f9
3 changed files with 4 additions and 4 deletions

View File

@@ -66,7 +66,7 @@ export type StructuredImportData = {
name: string;
path: string;
mimeType: string;
buffer: Buffer;
buffer: () => Promise<Buffer>;
/** Optional id from import source, useful for mapping */
sourceId?: string;
}[];
@@ -215,7 +215,7 @@ export default abstract class ImportTask extends BaseTask<Props> {
id: item.id,
name: item.name,
type: item.mimeType,
buffer: item.buffer,
buffer: await item.buffer(),
user,
ip,
transaction,