mirror of
https://github.com/overleaf/overleaf.git
synced 2025-01-30 20:11:25 +00:00
Use eachSeries rather than a job array
This commit is contained in:
parent
33904fe7be
commit
d9b301023a
1 changed files with 5 additions and 3 deletions
|
@ -49,15 +49,17 @@ module.exports = FileSystemImportManager =
|
|||
return callback("path is symlink")
|
||||
fs.readdir folderPath, (error, entries = []) =>
|
||||
return callback(error) if error?
|
||||
jobs = _.map entries, (entry) =>
|
||||
(callback) =>
|
||||
async.eachSeries(
|
||||
entries,
|
||||
(entry, callback) =>
|
||||
FileTypeManager.shouldIgnore entry, (error, ignore) =>
|
||||
return callback(error) if error?
|
||||
if !ignore
|
||||
FileSystemImportManager.addEntity user_id, project_id, parent_folder_id, entry, "#{folderPath}/#{entry}", replace, callback
|
||||
else
|
||||
callback()
|
||||
async.series jobs, callback
|
||||
callback
|
||||
)
|
||||
|
||||
addEntity: (user_id, project_id, folder_id, name, path, replace, callback = (error, entity)-> ) ->
|
||||
FileSystemImportManager._isSafeOnFileSystem path, (err, isSafe)->
|
||||
|
|
Loading…
Reference in a new issue