mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-15 14:43:46 +01:00
[misc] run format_fix and lint:fix
This commit is contained in:
@@ -29,15 +29,15 @@ module.exports = OutputFileOptimiser = {
|
||||
callback = function (error) {}
|
||||
}
|
||||
if (src.match(/\/output\.pdf$/)) {
|
||||
return OutputFileOptimiser.checkIfPDFIsOptimised(src, function (
|
||||
err,
|
||||
isOptimised
|
||||
) {
|
||||
if (err != null || isOptimised) {
|
||||
return callback(null)
|
||||
return OutputFileOptimiser.checkIfPDFIsOptimised(
|
||||
src,
|
||||
function (err, isOptimised) {
|
||||
if (err != null || isOptimised) {
|
||||
return callback(null)
|
||||
}
|
||||
return OutputFileOptimiser.optimisePDF(src, dst, callback)
|
||||
}
|
||||
return OutputFileOptimiser.optimisePDF(src, dst, callback)
|
||||
})
|
||||
)
|
||||
} else {
|
||||
return callback(null)
|
||||
}
|
||||
@@ -77,7 +77,7 @@ module.exports = OutputFileOptimiser = {
|
||||
const timer = new Metrics.Timer('qpdf')
|
||||
const proc = spawn('qpdf', args)
|
||||
let stdout = ''
|
||||
proc.stdout.setEncoding('utf8').on('data', (chunk) => (stdout += chunk))
|
||||
proc.stdout.setEncoding('utf8').on('data', chunk => (stdout += chunk))
|
||||
callback = _.once(callback) // avoid double call back for error and close event
|
||||
proc.on('error', function (err) {
|
||||
logger.warn({ err, args }, 'qpdf failed')
|
||||
@@ -99,5 +99,5 @@ module.exports = OutputFileOptimiser = {
|
||||
return callback(null)
|
||||
})
|
||||
})
|
||||
} // ignore the error
|
||||
}, // ignore the error
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user