mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-11-30 18:53:08 +02:00
Reduce memory usage in file migration tool
This commit is contained in:
parent
1117ce4b54
commit
bf98a11b65
1 changed files with 8 additions and 0 deletions
|
@ -11,8 +11,16 @@ DriveFile.find({
|
||||||
}, {
|
}, {
|
||||||
withoutChunks: false
|
withoutChunks: false
|
||||||
}]
|
}]
|
||||||
|
}, {
|
||||||
|
fields: {
|
||||||
|
_id: true
|
||||||
|
}
|
||||||
}).then(async files => {
|
}).then(async files => {
|
||||||
|
console.log(`there is ${files.length} files`);
|
||||||
|
|
||||||
await sequential(files.map(file => async () => {
|
await sequential(files.map(file => async () => {
|
||||||
|
file = await DriveFile.findOne({ _id: file._id });
|
||||||
|
|
||||||
const minio = new Minio.Client(config.drive.config);
|
const minio = new Minio.Client(config.drive.config);
|
||||||
|
|
||||||
const keyDir = `${config.drive.prefix}/${uuid.v4()}`;
|
const keyDir = `${config.drive.prefix}/${uuid.v4()}`;
|
||||||
|
|
Loading…
Reference in a new issue