fix where cacheWarm param is read from and improved some logging

This commit is contained in:
Henry Oswald 2014-02-26 09:06:47 +00:00
parent d41eca68a2
commit 49ffeb633d
3 changed files with 7 additions and 7 deletions

View file

@ -17,7 +17,7 @@ module.exports =
if err? if err?
logger.err err:err, key:key, bucket:bucket, format:format, style:style, "problem getting file" logger.err err:err, key:key, bucket:bucket, format:format, style:style, "problem getting file"
res.send 500 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" logger.log key:key, bucket:bucket, format:format, style:style, "request is only for cache warm so not sending stream"
res.send 200 res.send 200
else else

View file

@ -22,9 +22,9 @@ module.exports =
exec args, opts, (err, stdout, stderr)-> exec args, opts, (err, stdout, stderr)->
timer.done() timer.done()
if err? 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 else
logger.log sourcePath:sourcePath, requestedFormat:requestedFormat, "finished converting file" logger.log sourcePath:sourcePath, requestedFormat:requestedFormat, destPath:destPath, "finished converting file"
callback(err, destPath) callback(err, destPath)
thumbnail: (sourcePath, callback)-> thumbnail: (sourcePath, callback)->
@ -43,7 +43,7 @@ module.exports =
if err? 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, "something went wrong converting file to preview"
else else
logger.log sourcePath:sourcePath, "finished thumbnailing file" logger.log sourcePath:sourcePath, destPath:destPath, "finished thumbnailing file"
callback(err, destPath) callback(err, destPath)
preview: (sourcePath, callback)-> preview: (sourcePath, callback)->
@ -60,7 +60,7 @@ module.exports =
timeout: twentySeconds timeout: twentySeconds
exec args, opts,(err, stdout, stderr)-> exec args, opts,(err, stdout, stderr)->
if err? 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 else
logger.log sourcePath:sourcePath, "finished converting file to preview" logger.log sourcePath:sourcePath, destPath:destPath, "finished converting file to preview"
callback(err, destPath) callback(err, destPath)

View file

@ -56,7 +56,7 @@ describe "FileController", ->
@controller.getFile @req, @res @controller.getFile @req, @res
it "should send a 200 if the cacheWarm param is true", (done)-> 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) @FileHandler.getFile.callsArgWith(3, null, @fileStream)
@res.send = (statusCode)=> @res.send = (statusCode)=>
statusCode.should.equal 200 statusCode.should.equal 200