From bf35791655f434181032cd2319634f0701348448 Mon Sep 17 00:00:00 2001 From: Yury Shkoda Date: Thu, 21 Sep 2023 17:52:28 +0300 Subject: [PATCH] chore(lint): fixed Session.ts --- api/src/controllers/internal/Session.ts | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/api/src/controllers/internal/Session.ts b/api/src/controllers/internal/Session.ts index 31ee7f3..cb3ba68 100644 --- a/api/src/controllers/internal/Session.ts +++ b/api/src/controllers/internal/Session.ts @@ -190,20 +190,17 @@ ${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() + 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 - ) + this.scheduleSessionDestroy(session) + } else { + await this.deleteSession(session) + } + }, parseInt(session.deathTimeStamp) - new Date().getTime() - 100) } }