From 5d6e0d0f37fe7355fea28e186b0e092bbdb1f0da Mon Sep 17 00:00:00 2001 From: syuilo Date: Thu, 11 Apr 2019 16:15:27 +0900 Subject: [PATCH] Update migrate.ts --- src/migrate.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/migrate.ts b/src/migrate.ts index 48a5a09e2..2be7f2c97 100644 --- a/src/migrate.ts +++ b/src/migrate.ts @@ -171,7 +171,7 @@ async function main() { md5: file.md5, name: file.filename, type: file.contentType, - properties: file.metadata.properties, + properties: file.metadata.properties || {}, size: file.length, url: file.metadata.url, uri: file.metadata.uri, @@ -376,7 +376,12 @@ async function main() { skip: i }); try { - await migrateDriveFile(file); + try { + await migrateDriveFile(file); + } catch (_) { + file.folderId = null; + 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')}`);