From 59c25fc703d0c092c9c3f0dfc0875754a9d92566 Mon Sep 17 00:00:00 2001 From: Brian Gough Date: Mon, 16 Mar 2015 16:47:14 +0000 Subject: [PATCH] remove unnecessary call to async.series in OutputFileFinder callback was previously async but is now synchronous, so high stack usage. --- .../clsi/app/coffee/OutputFileFinder.coffee | 20 ++++++------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/services/clsi/app/coffee/OutputFileFinder.coffee b/services/clsi/app/coffee/OutputFileFinder.coffee index 26f07cb735..dcec5f5df6 100644 --- a/services/clsi/app/coffee/OutputFileFinder.coffee +++ b/services/clsi/app/coffee/OutputFileFinder.coffee @@ -17,20 +17,12 @@ module.exports = OutputFileFinder = jobs = [] outputFiles = [] for file in allFiles - do (file) -> - jobs.push (callback) -> - if incomingResources[file] - return callback() - else - outputFiles.push { - path: file - type: file.match(/\.([^\.]+)$/)?[1] - } - callback() - - async.series jobs, (error) -> - return callback(error) if error? - callback null, outputFiles + if !incomingResources[file] + outputFiles.push { + path: file + type: file.match(/\.([^\.]+)$/)?[1] + } + callback null, outputFiles _getAllFiles: (directory, _callback = (error, fileList) ->) -> callback = (error, fileList) ->