prevent dead loop try again
This commit is contained in:
parent
255390180d
commit
8cec4de6d0
|
@ -545,7 +545,7 @@ async function create_folders ({ source, old_mapping, folders, root, task_id, se
|
|||
console.log('排队等候的目录数量', limit.pendingCount)
|
||||
}, LOG_DELAY)
|
||||
|
||||
while (same_levels.length) {
|
||||
while (same_levels.length && (limit.activeCount || limit.pendingCount)) {
|
||||
await Promise.all(same_levels.map(async v => {
|
||||
const { name, id, parent } = v
|
||||
const target = mapping[parent] || root
|
||||
|
@ -557,7 +557,6 @@ async function create_folders ({ source, old_mapping, folders, root, task_id, se
|
|||
}))
|
||||
folders = folders.filter(v => !mapping[v.id])
|
||||
same_levels = [].concat(...same_levels.map(v => folders.filter(vv => vv.parent === v.id)))
|
||||
// if (!limit.activeCount && !limit.pendingCount) break
|
||||
}
|
||||
|
||||
clearInterval(loop)
|
||||
|
|
Loading…
Reference in New Issue