From 49ad408b30d1497da456439a8ae3b5fca996b909 Mon Sep 17 00:00:00 2001 From: Simon Detheridge Date: Wed, 12 Feb 2020 10:32:26 +0000 Subject: [PATCH] Remove unused imports and format correctly --- services/filestore/app/js/S3Persistor.js | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/services/filestore/app/js/S3Persistor.js b/services/filestore/app/js/S3Persistor.js index 196d2aecda..891d7be68e 100644 --- a/services/filestore/app/js/S3Persistor.js +++ b/services/filestore/app/js/S3Persistor.js @@ -8,12 +8,10 @@ const metrics = require('metrics-sharelatex') const PersistorHelper = require('./PersistorHelper') -const meter = require('stream-meter') -const Stream = require('stream') const fs = require('fs') const S3 = require('aws-sdk/clients/s3') const { URL } = require('url') -const { callbackify, promisify } = require('util') +const { callbackify } = require('util') const { WriteError, ReadError, @@ -48,8 +46,6 @@ const S3Persistor = { module.exports = S3Persistor -const pipeline = promisify(Stream.pipeline) - function hexToBase64(hex) { return Buffer.from(hex, 'hex').toString('base64') } @@ -81,10 +77,13 @@ async function sendStream(bucketName, key, readStream, sourceMd5) { hashPromise = PersistorHelper.calculateStreamMd5(readStream) } - const meteredStream = PersistorHelper.getMeteredStream(readStream, (_, byteCount) => { - // ignore the error parameter and just log the byte count - metrics.count('s3.egress', byteCount) - }) + const meteredStream = PersistorHelper.getMeteredStream( + readStream, + (_, byteCount) => { + // ignore the error parameter and just log the byte count + metrics.count('s3.egress', byteCount) + } + ) // if we have an md5 hash, pass this to S3 to verify the upload const uploadOptions = {