Skip to content

Commit

Permalink
fix(execution): removed empty webout from response
Browse files Browse the repository at this point in the history
  • Loading branch information
YuryShkoda committed Apr 28, 2023
1 parent c0f38ba commit 6dd2f4f
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions api/src/controllers/internal/Execution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down Expand Up @@ -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)
: ''
Expand All @@ -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:
Expand Down

0 comments on commit 6dd2f4f

Please sign in to comment.