Amend per several review comments

- Removed unused vars
- Label the metric with the bucket name
This commit is contained in:
Michael Mazour 2018-07-04 12:02:09 +01:00
parent feca8933f1
commit ece650741a

View file

@ -1,14 +1,9 @@
PersistorManager = require("./PersistorManager")
settings = require("settings-sharelatex")
logger = require("logger-sharelatex")
FileHandler = require("./FileHandler")
metrics = require("metrics-sharelatex")
parseRange = require('range-parser')
Errors = require('./Errors')
oneDayInSeconds = 60 * 60 * 24
maxSizeInBytes = 1024 * 1024 * 1024 # 1GB
module.exports = BucketController =
getFile: (req, res)->
@ -21,7 +16,7 @@ module.exports = BucketController =
bucket: bucket,
credentials: credentials
}
metrics.inc "getFile"
metrics.inc "#{bucket}.getFile"
logger.log key:key, bucket:bucket, "receiving request to get file from bucket"
FileHandler.getFile bucket, key, options, (err, fileStream)->
if err?
@ -33,4 +28,3 @@ module.exports = BucketController =
else
logger.log key:key, bucket:bucket, format:format, style:style, "sending bucket file to response"
fileStream.pipe res