Begin work towards obeying 'Range' headers, thread the opts down to persistence layer.

This commit is contained in:
Shane Kilkelly 2015-08-27 15:21:33 +01:00
parent 2e08281b88
commit 57aedefdd3
4 changed files with 5 additions and 5 deletions

View file

@ -27,7 +27,7 @@ module.exports =
return callback err
@sendFile location, target, fsPath, callback
getFileStream: (location, name, _callback = (err, res)->) ->
getFileStream: (location, name, opts, _callback = (err, res)->) ->
callback = (args...) ->
_callback(args...)
_callback = () ->

View file

@ -30,7 +30,7 @@ module.exports =
@_getConvertedFile bucket, key, opts, callback
_getStandardFile: (bucket, key, opts, callback)->
PersistorManager.getFileStream bucket, key, (err, fileStream)->
PersistorManager.getFileStream bucket, key, opts, (err, fileStream)->
if err?
logger.err bucket:bucket, key:key, opts:opts, "error getting fileStream"
callback err, fileStream

View file

@ -57,8 +57,8 @@ module.exports =
logger.err bucketName:bucketName, key:key, fsPath:fsPath, err:err, "something went wrong writing stream to disk"
return callback(err)
@sendFile bucketName, key, fsPath, callback
getFileStream: (bucketName, key, callback = (err, res)->)->
getFileStream: (bucketName, key, opts, callback = (err, res)->)->
callback = _.once callback
logger.log bucketName:bucketName, key:key, "getting file from s3"
s3Client = knox.createClient

View file

@ -104,7 +104,7 @@ describe "FileHandler", ->
beforeEach ->
@fileStream = {on:->}
@PersistorManager.getFileStream.callsArgWith(2, "err", @fileStream)
@PersistorManager.getFileStream.callsArgWith(3, "err", @fileStream)
it "should get the stream", (done)->
@handler.getFile @bucket, @key, null, =>