1
0
mirror of https://github.com/sasjs/server.git synced 2026-01-07 22:50:05 +00:00

chore(lint): fixed Session.ts

This commit is contained in:
Yury Shkoda
2023-09-21 17:52:28 +03:00
parent 2dc11630e4
commit bf35791655

View File

@@ -190,20 +190,17 @@ ${autoExecContent}`
} }
private scheduleSessionDestroy(session: Session) { private scheduleSessionDestroy(session: Session) {
setTimeout( setTimeout(async () => {
async () => { if (session.inUse) {
if (session.inUse) { // adding 10 more minutes
// adding 10 more minutes const newDeathTimeStamp = parseInt(session.deathTimeStamp) + 10 * 1000
const newDeathTimeStamp = parseInt(session.deathTimeStamp) + 10 * 1000 session.deathTimeStamp = newDeathTimeStamp.toString()
session.deathTimeStamp = newDeathTimeStamp.toString()
this.scheduleSessionDestroy(session) this.scheduleSessionDestroy(session)
} else { } else {
await this.deleteSession(session) await this.deleteSession(session)
} }
}, }, parseInt(session.deathTimeStamp) - new Date().getTime() - 100)
parseInt(session.deathTimeStamp) - new Date().getTime() - 100
)
} }
} }