From 6dd2f4f87673336135bc7a6de0d2e143e192c025 Mon Sep 17 00:00:00 2001 From: Yury Shkoda Date: Fri, 28 Apr 2023 17:25:30 +0300 Subject: [PATCH] fix(execution): removed empty webout from response --- api/src/controllers/internal/Execution.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/api/src/controllers/internal/Execution.ts b/api/src/controllers/internal/Execution.ts index 28e7424..32611bd 100644 --- a/api/src/controllers/internal/Execution.ts +++ b/api/src/controllers/internal/Execution.ts @@ -78,7 +78,6 @@ export class ExecutionController { const logPath = path.join(session.path, 'log.log') const printOutputPath = path.join(session.path, 'output.lst') - console.log(`🤖[printOutputPath]🤖`, printOutputPath) const headersPath = path.join(session.path, 'stpsrv_header.txt') const weboutPath = path.join(session.path, 'webout.txt') @@ -107,7 +106,6 @@ export class ExecutionController { const printOutput = (await fileExists(printOutputPath)) ? await readFile(printOutputPath) : '' - console.log(`🤖[printOutput]🤖`, printOutput) const headersContent = (await fileExists(headersPath)) ? await readFile(headersPath) : '' @@ -128,15 +126,18 @@ export class ExecutionController { // it should be deleted by scheduleSessionDestroy session.inUse = false - const resultParts = [webout, process.logsUUID, log] + const resultParts = [] + + if (webout) resultParts.push(webout) + + resultParts.push(process.logsUUID) + resultParts.push(log) if (printOutput) { resultParts.push(process.logsUUID) resultParts.push(printOutput) } - console.log(`🤖[resultParts]🤖`, resultParts) - return { httpHeaders, result: