Skip to content
Snippets Groups Projects
Unverified Commit bf98a11b authored by syuilo's avatar syuilo
Browse files

Reduce memory usage in file migration tool

parent 1117ce4b
No related merge requests found
......@@ -11,8 +11,16 @@ DriveFile.find({
}, {
withoutChunks: false
}]
}, {
fields: {
_id: true
}
}).then(async files => {
console.log(`there is ${files.length} files`);
await sequential(files.map(file => async () => {
file = await DriveFile.findOne({ _id: file._id });
const minio = new Minio.Client(config.drive.config);
const keyDir = `${config.drive.prefix}/${uuid.v4()}`;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment