prevent dead loop

This commit is contained in:
Issue哥 2020-06-27 20:29:05 +08:00
parent 6f1124a623
commit 97bd5d0f60
2 changed files with 2 additions and 1 deletions

View File

@ -18,7 +18,7 @@ app.use(ctx => {
}) })
const PORT = 23333 const PORT = 23333
app.listen(PORT, '127.0.0.1', console.log('http://127.0.0.1:' + PORT)) app.listen(PORT, '0.0.0.0', console.log('http://127.0.0.1:' + PORT))
async function catcher (ctx, next) { async function catcher (ctx, next) {
try { try {

View File

@ -557,6 +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)))
if (!limit.activeCount && !limit.pendingCount) break
} }
clearInterval(loop) clearInterval(loop)