Merge pull request #1256 from sharelatex/sk-file-upload-retry

Add a retry around `FileStoreHandler.uploadFileFromDisk`

GitOrigin-RevId: 2fc54036acdeda15c00a3d0222fd1a83683a5798
This commit is contained in:
Shane Kilkelly
2018-12-13 15:09:48 +00:00
committed by sharelatex
parent 362c1f64db
commit c423e483ba
2 changed files with 12 additions and 0 deletions
@@ -115,6 +115,7 @@ describe "FileStoreHandler", ->
cb({statusCode: 500})
it 'should callback with an error', (done) ->
@fs.createReadStream.callCount = 0
@fs.createReadStream.returns
pipe:->
on: (type, cb)->
@@ -123,6 +124,7 @@ describe "FileStoreHandler", ->
@handler.uploadFileFromDisk @project_id, @file_id, @fsPath, (err) =>
expect(err).to.exist
expect(err).to.be.instanceof Error
expect(@fs.createReadStream.callCount).to.equal @handler.RETRY_ATTEMPTS
done()
describe "deleteFile", ->