mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-29 16:23:39 -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
|
return callback err
|
||||||
@sendFile location, target, fsPath, callback
|
@sendFile location, target, fsPath, callback
|
||||||
|
|
||||||
getFileStream: (location, name, _callback = (err, res)->) ->
|
getFileStream: (location, name, opts, _callback = (err, res)->) ->
|
||||||
callback = (args...) ->
|
callback = (args...) ->
|
||||||
_callback(args...)
|
_callback(args...)
|
||||||
_callback = () ->
|
_callback = () ->
|
||||||
|
|
|
@ -30,7 +30,7 @@ module.exports =
|
||||||
@_getConvertedFile bucket, key, opts, callback
|
@_getConvertedFile bucket, key, opts, callback
|
||||||
|
|
||||||
_getStandardFile: (bucket, key, opts, callback)->
|
_getStandardFile: (bucket, key, opts, callback)->
|
||||||
PersistorManager.getFileStream bucket, key, (err, fileStream)->
|
PersistorManager.getFileStream bucket, key, opts, (err, fileStream)->
|
||||||
if err?
|
if err?
|
||||||
logger.err bucket:bucket, key:key, opts:opts, "error getting fileStream"
|
logger.err bucket:bucket, key:key, opts:opts, "error getting fileStream"
|
||||||
callback err, fileStream
|
callback err, fileStream
|
||||||
|
|
|
@ -58,7 +58,7 @@ module.exports =
|
||||||
return callback(err)
|
return callback(err)
|
||||||
@sendFile bucketName, key, fsPath, callback
|
@sendFile bucketName, key, fsPath, callback
|
||||||
|
|
||||||
getFileStream: (bucketName, key, callback = (err, res)->)->
|
getFileStream: (bucketName, key, opts, callback = (err, res)->)->
|
||||||
callback = _.once callback
|
callback = _.once callback
|
||||||
logger.log bucketName:bucketName, key:key, "getting file from s3"
|
logger.log bucketName:bucketName, key:key, "getting file from s3"
|
||||||
s3Client = knox.createClient
|
s3Client = knox.createClient
|
||||||
|
|
|
@ -104,7 +104,7 @@ describe "FileHandler", ->
|
||||||
|
|
||||||
beforeEach ->
|
beforeEach ->
|
||||||
@fileStream = {on:->}
|
@fileStream = {on:->}
|
||||||
@PersistorManager.getFileStream.callsArgWith(2, "err", @fileStream)
|
@PersistorManager.getFileStream.callsArgWith(3, "err", @fileStream)
|
||||||
|
|
||||||
it "should get the stream", (done)->
|
it "should get the stream", (done)->
|
||||||
@handler.getFile @bucket, @key, null, =>
|
@handler.getFile @bucket, @key, null, =>
|
||||||
|
|
Loading…
Reference in a new issue