Skip to content
Snippets Groups Projects
Commit 0945fc75 authored by Yogmatee Roochun's avatar Yogmatee Roochun
Browse files

#1168: additional logs added

parent 0a453ed4
No related branches found
No related tags found
3 merge requests!380Pipeline changes,!379Build step added for the master branch,!378k8s release
...@@ -75,6 +75,7 @@ const tidyUp = async (filePath, tmpPath, manId, isError) => { ...@@ -75,6 +75,7 @@ const tidyUp = async (filePath, tmpPath, manId, isError) => {
} }
if (isError) { if (isError) {
logger.info(`Error in Bulk import process for ${filePath}`) logger.info(`Error in Bulk import process for ${filePath}`)
logger.info(`File has been moved to ${updatedFilepath}`)
} else { } else {
logger.info( logger.info(
`Finished Bulk import process for ${filePath} as manuscript ${manId}.`, `Finished Bulk import process for ${filePath} as manuscript ${manId}.`,
...@@ -223,11 +224,12 @@ const runProcess = async (packagePath, submitter) => { ...@@ -223,11 +224,12 @@ const runProcess = async (packagePath, submitter) => {
const extractFiles = (source, dest) => const extractFiles = (source, dest) =>
new Promise((resolve, reject) => { new Promise((resolve, reject) => {
const cmd = `tar vzxf ${source} -C ${dest} --xform='s#^.+/##x'` // the xform removes all directories const cmd = `tar vzxf ${source} -C ${dest} --xform='s#^.+/##x'` // the xform removes all directories
exec(cmd, err => { exec(cmd, async err => {
if (err) { if (err) {
logger.error('Error extracting FTP bulk upload files') logger.error('Error extracting FTP bulk upload files')
// node couldn't execute the command // node couldn't execute the command
tidyUp(source, dest, '', true) await tidyUp(source, dest, '', true)
logger.error(`${source} moved to Error folder`)
reject(err) reject(err)
} }
resolve(dest) resolve(dest)
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment