This commit is contained in:
syuilo 2018-05-04 17:27:14 +09:00
parent 97b7567770
commit 06c453c3bc
2 changed files with 50 additions and 31 deletions

View file

@ -16,10 +16,6 @@ async function main() {
for (let i = 0; i < count; i++) {
promiseGens.push(() => {
const promise = new Promise(async (res, rej) => {
function skip() {
res([i, file, false]);
}
const file = await DriveFile.findOne(prev ? {
_id: { $lt: prev._id }
} : {}, {
@ -30,6 +26,10 @@ async function main() {
prev = file;
function skip() {
res([i, file, false]);
}
if (file == null) return skip();
log(chalk`{gray ${i}} scanning {bold ${file._id}} ${file.filename} ...`);