diff --git a/services/track-changes/app/coffee/MongoAWS.coffee b/services/track-changes/app/coffee/MongoAWS.coffee index 4ee2acaa7a..c6712e29f1 100644 --- a/services/track-changes/app/coffee/MongoAWS.coffee +++ b/services/track-changes/app/coffee/MongoAWS.coffee @@ -9,12 +9,11 @@ zlib = require "zlib" DAYS = 24 * 3600 * 1000 # one day in milliseconds -AWS_CONFIG = { - accessKeyId: settings.trackchanges.s3.key - secretAccessKey: settings.trackchanges.s3.secret -} - createStream = (streamConstructor, project_id, doc_id, pack_id) -> + AWS_CONFIG = + accessKeyId: settings.trackchanges.s3.key + secretAccessKey: settings.trackchanges.s3.secret + return streamConstructor new AWS.S3(AWS_CONFIG), { "Bucket": settings.trackchanges.stores.doc_history, "Key": project_id+"/changes-"+doc_id+"/pack-"+pack_id