|
|
@@ -67,6 +67,9 @@ module.exports = DocArchive =
|
|
|
if err? || res.statusCode != 200
|
|
|
logger.err err:err, res:res, project_id:project_id, doc_id:doc_id, "something went wrong unarchiving doc from aws"
|
|
|
return callback new Errors.NotFoundError("Error in S3 request")
|
|
|
+ if !(lines instanceof Array)
|
|
|
+ logger.err err:err, res:res, project_id:project_id, doc_id:doc_id, lines:lines, "doc lines from aws are not in array format, likely not JSON parsable"
|
|
|
+ return callback(new Error("Error unpacking doc"))
|
|
|
MongoManager.upsertIntoDocCollection project_id, doc_id.toString(), {lines}, (err) ->
|
|
|
return callback(err) if err?
|
|
|
logger.log project_id: project_id, doc_id: doc_id, "deleting doc from s3"
|
|
|
@@ -87,4 +90,4 @@ module.exports = DocArchive =
|
|
|
timeout: thirtySeconds
|
|
|
json: content
|
|
|
uri:"https://#{settings.docstore.s3.bucket}.s3.amazonaws.com/#{key}"
|
|
|
- }
|
|
|
+ }
|