mirror of
https://github.com/sasjs/server.git
synced 2026-01-10 16:00:05 +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()
|
const session = await sessionController.getSession()
|
||||||
console.log('using session', session.id)
|
console.log('using session', session.id)
|
||||||
session.inUse = true
|
session.inUse = true
|
||||||
|
session.consumed = true
|
||||||
|
|
||||||
const logPath = path.join(session.path, 'log.log')
|
const logPath = path.join(session.path, 'log.log')
|
||||||
|
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ export class SessionController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private getReadySessions = (): Session[] =>
|
private getReadySessions = (): Session[] =>
|
||||||
this.sessions.filter((sess: Session) => sess.ready)
|
this.sessions.filter((sess: Session) => sess.ready && !sess.consumed)
|
||||||
|
|
||||||
private async createSession(): Promise<Session> {
|
private async createSession(): Promise<Session> {
|
||||||
const sessionId = generateUniqueFileName(generateTimestamp())
|
const sessionId = generateUniqueFileName(generateTimestamp())
|
||||||
@@ -52,6 +52,7 @@ export class SessionController {
|
|||||||
id: sessionId,
|
id: sessionId,
|
||||||
ready: false,
|
ready: false,
|
||||||
inUse: false,
|
inUse: false,
|
||||||
|
consumed: false,
|
||||||
completed: false,
|
completed: false,
|
||||||
creationTimeStamp,
|
creationTimeStamp,
|
||||||
deathTimeStamp,
|
deathTimeStamp,
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ export interface Session {
|
|||||||
deathTimeStamp: string
|
deathTimeStamp: string
|
||||||
path: string
|
path: string
|
||||||
inUse: boolean
|
inUse: boolean
|
||||||
|
consumed: boolean
|
||||||
completed: boolean
|
completed: boolean
|
||||||
crashed?: string
|
crashed?: string
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user