mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
read wordcount output asynchronously
This commit is contained in:
parent
872dbc5215
commit
400590b3ad
1 changed files with 5 additions and 6 deletions
|
@ -233,12 +233,11 @@ module.exports = CompileManager =
|
|||
|
||||
CommandRunner.run compileName, command, directory, image, timeout, {}, (error) ->
|
||||
return callback(error) if error?
|
||||
try
|
||||
stdout = fs.readFileSync(directory + "/" + file_name + ".wc", "utf-8")
|
||||
catch err
|
||||
logger.err err:err, command:command, directory:directory, project_id:project_id, user_id:user_id, "error reading word count output"
|
||||
return callback(err)
|
||||
callback null, CompileManager._parseWordcountFromOutput(stdout)
|
||||
fs.readFile directory + "/" + file_name + ".wc", "utf-8", (err, stdout) ->
|
||||
if err?
|
||||
logger.err err:err, command:command, directory:directory, project_id:project_id, user_id:user_id, "error reading word count output"
|
||||
return callback(err)
|
||||
callback null, CompileManager._parseWordcountFromOutput(stdout)
|
||||
|
||||
_parseWordcountFromOutput: (output) ->
|
||||
results = {
|
||||
|
|
Loading…
Reference in a new issue