Update migrate.ts

This commit is contained in:
syuilo 2019-04-11 16:15:27 +09:00
parent 1faa24fcb4
commit e7fef006f1

View File

@ -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,
@ -375,8 +375,13 @@ async function main() {
const file = await _DriveFile.findOne({}, {
skip: i
});
try {
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')}`);