stupid me

This commit is contained in:
Issue哥 2020-06-27 21:39:04 +08:00
parent 8cec4de6d0
commit cb37371c85
1 changed files with 2 additions and 2 deletions

View File

@ -545,7 +545,7 @@ async function create_folders ({ source, old_mapping, folders, root, task_id, se
console.log('排队等候的目录数量', limit.pendingCount) console.log('排队等候的目录数量', limit.pendingCount)
}, LOG_DELAY) }, LOG_DELAY)
while (same_levels.length && (limit.activeCount || limit.pendingCount)) { do {
await Promise.all(same_levels.map(async v => { await Promise.all(same_levels.map(async v => {
const { name, id, parent } = v const { name, id, parent } = v
const target = mapping[parent] || root const target = mapping[parent] || root
@ -557,7 +557,7 @@ async function create_folders ({ source, old_mapping, folders, root, task_id, se
})) }))
folders = folders.filter(v => !mapping[v.id]) folders = folders.filter(v => !mapping[v.id])
same_levels = [].concat(...same_levels.map(v => folders.filter(vv => vv.parent === v.id))) same_levels = [].concat(...same_levels.map(v => folders.filter(vv => vv.parent === v.id)))
} } while (same_levels.length && (limit.activeCount || limit.pendingCount))
clearInterval(loop) clearInterval(loop)
return mapping return mapping