mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Begin work towards obeying 'Range' headers, thread the opts
down to persistence layer.
This commit is contained in:
parent
2e08281b88
commit
57aedefdd3
4 changed files with 5 additions and 5 deletions
|
@ -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 = () ->
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -58,7 +58,7 @@ module.exports =
|
|||
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
|
||||
|
|
|
@ -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, =>
|
||||
|
|
Loading…
Reference in a new issue