💽 mongo import endpoint

This commit is contained in:
2021-06-02 09:02:32 -07:00
parent 56a8165368
commit 06d0c6aa72
9 changed files with 175 additions and 40 deletions

View File

@@ -205,12 +205,15 @@ export const unzip = async (
}
if (fileName !== "" && entry.type !== "Directory") {
logger.info(`Attempting to write ${fileName}`);
entry.pipe(createWriteStream(paths.targetPath + "/" + fileName));
extractedFiles.push({
name: fileName,
fileSize: size,
path: paths.targetPath,
});
entry
.pipe(createWriteStream(paths.targetPath + "/" + fileName))
.on("finish", () => {
extractedFiles.push({
name: fileName,
fileSize: size,
path: paths.targetPath,
});
});
}
entry.autodrain();
}