1
0
mirror of https://github.com/hotomoe/hotomoe synced 2024-12-01 16:28:12 +09:00

Update migrate.ts

This commit is contained in:
syuilo 2019-04-11 22:49:12 +09:00
parent 4d688be3df
commit d4ad36fa41
No known key found for this signature in database
GPG Key ID: BDC4C49D06AB9D69

View File

@ -162,6 +162,7 @@ async function main() {
const user = await _User.findOne({
_id: file.metadata.userId
});
if (user == null) return;
if (file.metadata.storage && file.metadata.storage.key) { // when object storage
await DriveFiles.save({
id: file._id.toHexString(),
@ -386,12 +387,7 @@ async function main() {
skip: i
});
try {
try {
await migrateDriveFile(file);
} catch (_) {
file.folderId = null;
await migrateDriveFile(file);
}
await migrateDriveFile(file);
console.log(`FILE (${i + 1}/${allDriveFilesCount}) ${file._id} ${chalk.green('DONE')}`);
} catch (e) {
console.log(`FILE (${i + 1}/${allDriveFilesCount}) ${file._id} ${chalk.red('ERR')}`);