fix(striker-ui-api): disable toush session

main
Tsu-ba-me 1 year ago
parent a7709df2a6
commit 6d878e8eb0
  1. 34
      striker-ui-api/src/middlewares/session.ts

@ -146,21 +146,25 @@ export class SessionStore extends BaseSessionStore {
): Promise<void> {
stdoutVar({ session }, `Touch session ${sid}: `);
try {
const wcode = await write(
`UPDATE sessions
SET modified_date = '${timestamp()}'
WHERE session_uuid = '${sid}';`,
);
assert(wcode === 0, `Write exited with code ${wcode}`);
} catch (error) {
stderr(
`Failed to complete DB write in touch session ${sid}; CAUSE: ${error}`,
);
return done?.call(null, error);
}
// The intent of updating the session modified date is to avoid expiring the
// session when it's actively used by the user. But since the updates are
// flooding the database's history table, disable it for now.
// try {
// const wcode = await write(
// `UPDATE sessions
// SET modified_date = '${timestamp()}'
// WHERE session_uuid = '${sid}';`,
// );
// assert(wcode === 0, `Write exited with code ${wcode}`);
// } catch (error) {
// stderr(
// `Failed to complete DB write in touch session ${sid}; CAUSE: ${error}`,
// );
// return done?.call(null, error);
// }
return done?.call(null);
}

Loading…
Cancel
Save