Removing Container Name from Paths
This commit is contained in:
1 parent
797fb06544
commit
1909e8c54f
3 files changed
+4
-64
No files matched your search
+1
-7
@@ -119,11 +119,7 @@ function newFileCloud () {
|
||||
if (INFO_LOG === true) { logger.write('[INFO] getFile -> getFileRecursively -> filePath = ' + filePath) }
|
||||
if (INFO_LOG === true) { logger.write('[INFO] getFile -> getFileRecursively -> fileName = ' + fileName) }
|
||||
|
||||
let containerName
|
||||
|
||||
containerName = pDataMine.code.codeName.toLowerCase()
|
||||
|
||||
blobService.getBlobToText(containerName, filePath + '/' + fileName, undefined, onFileReceived)
|
||||
blobService.getBlobToText(filePath + '/' + fileName, undefined, onFileReceived)
|
||||
|
||||
function onFileReceived (err, text, response) {
|
||||
try {
|
||||
@@ -146,7 +142,6 @@ function newFileCloud () {
|
||||
return
|
||||
}
|
||||
|
||||
if (ERROR_LOG === true) { logger.write('[ERROR] getFile -> getFileRecursively -> onFileReceived -> containerName = ' + containerName) }
|
||||
if (ERROR_LOG === true) { logger.write('[ERROR] getFile -> getFileRecursively -> onFileReceived -> filePath = ' + filePath) }
|
||||
if (ERROR_LOG === true) { logger.write('[ERROR] getFile -> getFileRecursively -> onFileReceived -> fileName = ' + fileName) }
|
||||
if (ERROR_LOG === true) { logger.write('[ERROR] getFile -> getFileRecursively -> onFileReceived -> Unexpected Error Ocurred.') }
|
||||
@@ -181,7 +176,6 @@ function newFileCloud () {
|
||||
return
|
||||
} catch (err) {
|
||||
if (ERROR_LOG === true) { logger.write('[WARN] getFile -> getFileRecursively -> onFileReceived -> err = ' + err.stack) }
|
||||
if (ERROR_LOG === true) { logger.write('[ERROR] getFile -> getFileRecursively -> onFileReceived -> containerName = ' + containerName) }
|
||||
if (ERROR_LOG === true) { logger.write('[ERROR] getFile -> getFileRecursively -> onFileReceived -> filePath = ' + filePath) }
|
||||
if (ERROR_LOG === true) { logger.write('[ERROR] getFile -> getFileRecursively -> onFileReceived -> fileName = ' + fileName) }
|
||||
|
||||
|
||||
+3
-3
@@ -29,11 +29,11 @@ function newFileStorage () {
|
||||
|
||||
return thisObject
|
||||
|
||||
async function getBlobToText (container, filePath, host, callBackFunction) {
|
||||
async function getBlobToText (filePath, host, callBackFunction) {
|
||||
try {
|
||||
if (INFO_LOG === true) { logger.write('[INFO] getBlobToText -> Entering function.') }
|
||||
|
||||
callServer(undefined, 'Storage/' + container + '/' + filePath, (response, fileContent) => {
|
||||
callServer(undefined, 'Storage/' + filePath, (response, fileContent) => {
|
||||
if (response.result === GLOBAL.DEFAULT_OK_RESPONSE.result) {
|
||||
callBackFunction(GLOBAL.DEFAULT_OK_RESPONSE, fileContent)
|
||||
} else {
|
||||
@@ -44,7 +44,7 @@ function newFileStorage () {
|
||||
if (verifyRetry(err.code) && currentRetry < MAX_RETRY) {
|
||||
currentRetry++
|
||||
if (INFO_LOG === true) { console.log('[INFO] getTextFile -> Retrying connection to the server because received error: ' + err.code + '. Retry #: ' + currentRetry) }
|
||||
getBlobToText(container, filePath, host, callBackFunction)
|
||||
getBlobToText(filePath, host, callBackFunction)
|
||||
} else if (err.message === 'Request aborted') {
|
||||
let err = { code: 'The specified key does not exist.' }
|
||||
callBackFunction(err)
|
||||
|
||||
Reference in new issue
Block a user