mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
fix where cacheWarm param is read from and improved some logging
This commit is contained in:
parent
d41eca68a2
commit
49ffeb633d
3 changed files with 7 additions and 7 deletions
|
@ -17,7 +17,7 @@ module.exports =
|
|||
if err?
|
||||
logger.err err:err, key:key, bucket:bucket, format:format, style:style, "problem getting file"
|
||||
res.send 500
|
||||
else if req.params.cacheWarm
|
||||
else if req.query.cacheWarm
|
||||
logger.log key:key, bucket:bucket, format:format, style:style, "request is only for cache warm so not sending stream"
|
||||
res.send 200
|
||||
else
|
||||
|
|
|
@ -22,9 +22,9 @@ module.exports =
|
|||
exec args, opts, (err, stdout, stderr)->
|
||||
timer.done()
|
||||
if err?
|
||||
logger.err err:err, stderr:stderr, sourcePath:sourcePath, requestedFormat:requestedFormat, "something went wrong converting file"
|
||||
logger.err err:err, stderr:stderr, sourcePath:sourcePath, requestedFormat:requestedFormat, destPath:destPath, "something went wrong converting file"
|
||||
else
|
||||
logger.log sourcePath:sourcePath, requestedFormat:requestedFormat, "finished converting file"
|
||||
logger.log sourcePath:sourcePath, requestedFormat:requestedFormat, destPath:destPath, "finished converting file"
|
||||
callback(err, destPath)
|
||||
|
||||
thumbnail: (sourcePath, callback)->
|
||||
|
@ -43,7 +43,7 @@ module.exports =
|
|||
if err?
|
||||
logger.err err:err, stderr:stderr, sourcePath:sourcePath, "something went wrong converting file to preview"
|
||||
else
|
||||
logger.log sourcePath:sourcePath, "finished thumbnailing file"
|
||||
logger.log sourcePath:sourcePath, destPath:destPath, "finished thumbnailing file"
|
||||
callback(err, destPath)
|
||||
|
||||
preview: (sourcePath, callback)->
|
||||
|
@ -60,7 +60,7 @@ module.exports =
|
|||
timeout: twentySeconds
|
||||
exec args, opts,(err, stdout, stderr)->
|
||||
if err?
|
||||
logger.err err:err, stderr:stderr, sourcePath:sourcePath, "something went wrong converting file to preview"
|
||||
logger.err err:err, stderr:stderr, sourcePath:sourcePath, destPath:destPath, "something went wrong converting file to preview"
|
||||
else
|
||||
logger.log sourcePath:sourcePath, "finished converting file to preview"
|
||||
logger.log sourcePath:sourcePath, destPath:destPath, "finished converting file to preview"
|
||||
callback(err, destPath)
|
||||
|
|
|
@ -56,7 +56,7 @@ describe "FileController", ->
|
|||
@controller.getFile @req, @res
|
||||
|
||||
it "should send a 200 if the cacheWarm param is true", (done)->
|
||||
@req.params.cacheWarm = true
|
||||
@req.query.cacheWarm = true
|
||||
@FileHandler.getFile.callsArgWith(3, null, @fileStream)
|
||||
@res.send = (statusCode)=>
|
||||
statusCode.should.equal 200
|
||||
|
|
Loading…
Reference in a new issue