From 3e2202573f6278fd12982f1aaa6715d260f855b1 Mon Sep 17 00:00:00 2001 From: syuilo Date: Thu, 11 Apr 2019 22:49:12 +0900 Subject: [PATCH] Update migrate.ts --- src/migrate.ts | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/migrate.ts b/src/migrate.ts index 098dc0d7c..614b20cae 100644 --- a/src/migrate.ts +++ b/src/migrate.ts @@ -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')}`);