fix: Refactor attachment downloads during export to use promises (#5294

* Refactor attachment downloads during export to use promises instead of streams
Date attachments in zip file correctly

* tsc
This commit is contained in:
Tom Moor
2023-05-04 20:20:33 -04:00
committed by GitHub
parent d096ba486f
commit 9942bbee3e
6 changed files with 50 additions and 28 deletions

View File

@@ -3,6 +3,7 @@ import path from "path";
import JSZip from "jszip";
import { find } from "lodash";
import tmp from "tmp";
import { bytesToHumanReadable } from "@shared/utils/files";
import { ValidationError } from "@server/errors";
import Logger from "@server/logging/Logger";
import { trace } from "@server/logging/tracing";
@@ -114,10 +115,14 @@ export default class ZipHelper {
currentFile: metadata.currentFile,
percent,
};
const memory = process.memoryUsage();
Logger.debug(
"utils",
`Writing zip file progress… %${percent}`,
{ currentFile: metadata.currentFile }
`Writing zip file progress… ${percent}%`,
{
currentFile: metadata.currentFile,
memory: bytesToHumanReadable(memory.rss),
}
);
}
}