Skip to content

Commit

Permalink
Merge pull request #364 from sasjs/log-separator
Browse files Browse the repository at this point in the history
fix(log-separator): log separator should always wrap log
  • Loading branch information
YuryShkoda authored Jul 25, 2023
2 parents 48c1ada + 0f91395 commit 2f47a22
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 24 deletions.
7 changes: 3 additions & 4 deletions api/src/controllers/internal/Execution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,19 +128,18 @@ export class ExecutionController {
// INFO: webout can be a Buffer, that is why it's length should be checked to determine if it is empty
if (webout && webout.length !== 0) resultParts.push(webout)

// INFO: log separator wraps the log from the beginning and the end
resultParts.push(process.logsUUID)
resultParts.push(log)
resultParts.push(process.logsUUID)

if (includePrintOutput && runTime === RunTimeType.SAS) {
const printOutputPath = path.join(session.path, 'output.lst')
const printOutput = (await fileExists(printOutputPath))
? await readFile(printOutputPath)
: ''

if (printOutput) {
resultParts.push(process.logsUUID)
resultParts.push(printOutput)
}
if (printOutput) resultParts.push(printOutput)
}

return {
Expand Down
25 changes: 14 additions & 11 deletions api/src/controllers/internal/Session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,17 +190,20 @@ ${autoExecContent}`
}

private scheduleSessionDestroy(session: Session) {
setTimeout(async () => {
if (session.inUse) {
// adding 10 more minutes
const newDeathTimeStamp = parseInt(session.deathTimeStamp) + 10 * 1000
session.deathTimeStamp = newDeathTimeStamp.toString()

this.scheduleSessionDestroy(session)
} else {
await this.deleteSession(session)
}
}, parseInt(session.deathTimeStamp) - new Date().getTime() - 100)
setTimeout(
async () => {
if (session.inUse) {
// adding 10 more minutes
const newDeathTimeStamp = parseInt(session.deathTimeStamp) + 10 * 1000
session.deathTimeStamp = newDeathTimeStamp.toString()

this.scheduleSessionDestroy(session)
} else {
await this.deleteSession(session)
}
},
parseInt(session.deathTimeStamp) - new Date().getTime() - 100
)
}
}

Expand Down
11 changes: 5 additions & 6 deletions web/src/components/snackbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@ import Snackbar from '@mui/material/Snackbar'
import MuiAlert, { AlertProps } from '@mui/material/Alert'
import Slide, { SlideProps } from '@mui/material/Slide'

const Alert = React.forwardRef<HTMLDivElement, AlertProps>(function Alert(
props,
ref
) {
return <MuiAlert elevation={6} ref={ref} variant="filled" {...props} />
})
const Alert = React.forwardRef<HTMLDivElement, AlertProps>(
function Alert(props, ref) {
return <MuiAlert elevation={6} ref={ref} variant="filled" {...props} />
}
)

const Transition = (props: SlideProps) => {
return <Slide {...props} direction="up" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@
border: none;
outline: none;
transition: 0.4s;
box-shadow: rgba(0, 0, 0, 0.2) 0px 2px 1px -1px,
rgba(0, 0, 0, 0.14) 0px 1px 1px 0px, rgba(0, 0, 0, 0.12) 0px 1px 3px 0px;
box-shadow:
rgba(0, 0, 0, 0.2) 0px 2px 1px -1px,
rgba(0, 0, 0, 0.14) 0px 1px 1px 0px,
rgba(0, 0, 0, 0.12) 0px 1px 3px 0px;
}

.ChunkDetails {
Expand Down
2 changes: 1 addition & 1 deletion web/src/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
Expand Down

0 comments on commit 2f47a22

Please sign in to comment.