mirror of
https://github.com/sasjs/server.git
synced 2025-12-10 11:24:35 +00:00
fix: session should be marked as consumed
This commit is contained in:
@@ -38,6 +38,7 @@ export class ExecutionController {
|
||||
const session = await sessionController.getSession()
|
||||
console.log('using session', session.id)
|
||||
session.inUse = true
|
||||
session.consumed = true
|
||||
|
||||
const logPath = path.join(session.path, 'log.log')
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ export class SessionController {
|
||||
}
|
||||
|
||||
private getReadySessions = (): Session[] =>
|
||||
this.sessions.filter((sess: Session) => sess.ready)
|
||||
this.sessions.filter((sess: Session) => sess.ready && !sess.consumed)
|
||||
|
||||
private async createSession(): Promise<Session> {
|
||||
const sessionId = generateUniqueFileName(generateTimestamp())
|
||||
@@ -52,6 +52,7 @@ export class SessionController {
|
||||
id: sessionId,
|
||||
ready: false,
|
||||
inUse: false,
|
||||
consumed: false,
|
||||
completed: false,
|
||||
creationTimeStamp,
|
||||
deathTimeStamp,
|
||||
|
||||
@@ -5,6 +5,7 @@ export interface Session {
|
||||
deathTimeStamp: string
|
||||
path: string
|
||||
inUse: boolean
|
||||
consumed: boolean
|
||||
completed: boolean
|
||||
crashed?: string
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user