From 9c5772a30310fea1dc970db4f1484af7087fed0b Mon Sep 17 00:00:00 2001 From: Saad Jutt Date: Fri, 7 Jan 2022 16:42:38 +0500 Subject: [PATCH] chore: clean up --- api/src/controllers/internal/Execution.ts | 3 --- api/src/controllers/internal/Session.ts | 8 +++----- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/api/src/controllers/internal/Execution.ts b/api/src/controllers/internal/Execution.ts index c488d95..38cb88d 100644 --- a/api/src/controllers/internal/Execution.ts +++ b/api/src/controllers/internal/Execution.ts @@ -36,7 +36,6 @@ export class ExecutionController { const sessionController = getSessionController() const session = await sessionController.getSession() - console.log('using session', session.id) session.inUse = true session.consumed = true @@ -99,7 +98,6 @@ ${program}` // (which can mean SAS trying to run a partial program, or // failing due to file lock) we first create the file THEN // we rename it. - console.log('executing session', session.id) await createFile(codePath + '.bkp', program) await moveFile(codePath + '.bkp', codePath) @@ -107,7 +105,6 @@ ${program}` while (!session.completed) { await delay(50) } - console.log('completed session', session.id) const log = ((await fileExists(logPath)) ? await readFile(logPath) : '') + diff --git a/api/src/controllers/internal/Session.ts b/api/src/controllers/internal/Session.ts index 525a072..8e5ef75 100644 --- a/api/src/controllers/internal/Session.ts +++ b/api/src/controllers/internal/Session.ts @@ -21,6 +21,9 @@ const execFilePromise = promisify(execFile) export class SessionController { private sessions: Session[] = [] + private getReadySessions = (): Session[] => + this.sessions.filter((sess: Session) => sess.ready && !sess.consumed) + public async getSession() { const readySessions = this.getReadySessions() @@ -33,9 +36,6 @@ export class SessionController { return session } - private getReadySessions = (): Session[] => - this.sessions.filter((sess: Session) => sess.ready && !sess.consumed) - private async createSession(): Promise { const sessionId = generateUniqueFileName(generateTimestamp()) console.log('creating session', sessionId) @@ -108,8 +108,6 @@ export class SessionController { // the autoexec deletes the code.sas file await this.waitForSession(session) - console.log('session is ready', sessionId) - return session }