From 7e964e5237a2e84f0f39fccaa0f33874659d3f46 Mon Sep 17 00:00:00 2001 From: Yan Xu Date: Mon, 19 Aug 2024 12:00:50 -0600 Subject: [PATCH] Remove duplicate fastqs from inputs --- webapp/server/crons/pipelineMonitor.js | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/webapp/server/crons/pipelineMonitor.js b/webapp/server/crons/pipelineMonitor.js index 9f7c1c41..5ce73325 100644 --- a/webapp/server/crons/pipelineMonitor.js +++ b/webapp/server/crons/pipelineMonitor.js @@ -163,10 +163,10 @@ async function generateInputs(proj_home, conf, proj) { const fileCode = path.basename(fq); let name = await common.getRealName(fileCode); const inputFq = inputDir + "/" + name; - if(!fs.existsSync(inputFq)) { + if (!fs.existsSync(inputFq)) { fs.symlinkSync(fq, inputFq, 'file'); + inputs.push(inputFq); } - inputs.push(inputFq); } else { inputs.push(fq); } @@ -191,8 +191,10 @@ async function generateInputs(proj_home, conf, proj) { const fileCode = path.basename(fq1); let name = await common.getRealName(fileCode); const inputFq = inputDir + "/" + name; - fs.symlinkSync(fq1, inputFq, 'file'); - inputs_fq1.push(inputFq); + if (!fs.existsSync(inputFq)) { + fs.symlinkSync(fq1, inputFq, 'file'); + inputs_fq1.push(inputFq); + } } else { inputs_fq1.push(fq1); } @@ -206,8 +208,10 @@ async function generateInputs(proj_home, conf, proj) { const fileCode = path.basename(fq2); let name = await common.getRealName(fileCode); const inputFq = inputDir + "/" + name; - fs.symlinkSync(fq2, inputFq, 'file'); - inputs_fq2.push(inputFq); + if (!fs.existsSync(inputFq)) { + fs.symlinkSync(fq2, inputFq, 'file'); + inputs_fq2.push(inputFq); + } } else { inputs_fq2.push(fq2); }