From d59dcab8ee0e80f705c29a35eddc4996d7f1699c Mon Sep 17 00:00:00 2001 From: Matias Date: Wed, 10 Apr 2019 16:21:04 +0200 Subject: [PATCH] Desabling replication --- AzureBlobStorage.js | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/AzureBlobStorage.js b/AzureBlobStorage.js index ed0fac7a4..421919d04 100644 --- a/AzureBlobStorage.js +++ b/AzureBlobStorage.js @@ -27,7 +27,7 @@ exports.newAzureBlobBlobStorage = function newAzureBlobBlobStorage(BOT, logger) let environment = global.CURRENT_ENVIRONMENT; let Minio = require('minio'); // Temporary during migration - let minioClient; // Temporary during migration + // let minioClient; // Temporary during migration return thisObject; @@ -35,13 +35,13 @@ exports.newAzureBlobBlobStorage = function newAzureBlobBlobStorage(BOT, logger) try { - minioClient = new Minio.Client({ - endPoint: process.env.MINIO_END_POINT, - port: JSON.parse(process.env.MINIO_PORT), - useSSL: JSON.parse(process.env.MINIO_USE_SSL), - accessKey: process.env.MINIO_ACCESS_KEY, - secretKey: process.env.MINIO_SECRET_KEY - }) + // minioClient = new Minio.Client({ + // endPoint: process.env.MINIO_END_POINT, + // port: JSON.parse(process.env.MINIO_PORT), + // useSSL: JSON.parse(process.env.MINIO_USE_SSL), + // accessKey: process.env.MINIO_ACCESS_KEY, + // secretKey: process.env.MINIO_SECRET_KEY + // }) containerName = pDataOwner.toLowerCase(); @@ -130,14 +130,14 @@ exports.newAzureBlobBlobStorage = function newAzureBlobBlobStorage(BOT, logger) writeOnlyBlobService.createBlockBlobFromText(containerName, pFolderPath + "/" + pFileName, pFileContent, onFileCreated); /* REPLICATION TO MINIO */ - minioClient.putObject(containerName, pFolderPath + "/" + pFileName, pFileContent, 'text/plain', function (err) { - console.log(MODULE_NAME, "[INFO] 'createTextFile' -> Replicating to MINIO -> File = " + pFolderPath + "/" + pFileName); + // minioClient.putObject(containerName, pFolderPath + "/" + pFileName, pFileContent, 'text/plain', function (err) { + // console.log(MODULE_NAME, "[INFO] 'createTextFile' -> Replicating to MINIO -> File = " + pFolderPath + "/" + pFileName); - if (err) { - console.log(MODULE_NAME, "[WARN] 'createTextFile' -> Replicating to MINIO -> err = " + err.message); - } + // if (err) { + // console.log(MODULE_NAME, "[WARN] 'createTextFile' -> Replicating to MINIO -> err = " + err.message); + // } - }); // Temporary during migration + // }); // Temporary during migration function onFileCreated(err, result, response) { @@ -395,14 +395,14 @@ exports.newAzureBlobBlobStorage = function newAzureBlobBlobStorage(BOT, logger) callBackFunction(global.DEFAULT_OK_RESPONSE, text); /* REPLICATION TO MINIO */ - minioClient.putObject(containerName, pFolderPath + "/" + pFileName, text, 'text/plain', function (err, dataStream) { - console.log(MODULE_NAME, "[INFO] 'getTextFile' -> onFileReceived -> Replicating to MINIO -> File = " + pFolderPath + "/" + pFileName); + // minioClient.putObject(containerName, pFolderPath + "/" + pFileName, text, 'text/plain', function (err, dataStream) { + // console.log(MODULE_NAME, "[INFO] 'getTextFile' -> onFileReceived -> Replicating to MINIO -> File = " + pFolderPath + "/" + pFileName); - if (err) { - console.log(MODULE_NAME, "[WARN] 'getTextFile' -> onFileReceived -> Replicating to MINIO -> err = " + err.message); - } - - }); // Temporary during migration + // if (err) { + // console.log(MODULE_NAME, "[WARN] 'getTextFile' -> onFileReceived -> Replicating to MINIO -> err = " + err.message); + // } + + // }); // Temporary during migration } } catch (err) { @@ -417,4 +417,4 @@ exports.newAzureBlobBlobStorage = function newAzureBlobBlobStorage(BOT, logger) } } -}; \ No newline at end of file +};