1 file changed
+22
-22
+22
-22
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
};
|
||||
Reference in new issue
Block a user