mirror of
https://github.com/zadam/trilium.git
synced 2025-10-22 21:39:23 +08:00
feat(server/session): clean up expired sessions
This commit is contained in:
parent
43ab13e126
commit
15a513d7cd
1 changed files with 7 additions and 0 deletions
|
@ -62,4 +62,11 @@ const sessionParser = session({
|
||||||
store: new SQLiteSessionStore()
|
store: new SQLiteSessionStore()
|
||||||
});
|
});
|
||||||
|
|
||||||
|
setInterval(() => {
|
||||||
|
// Clean up expired sesions.
|
||||||
|
const now = Date.now();
|
||||||
|
const result = sql.execute(/*sql*/`DELETE FROM sessions WHERE expires < ?`, now);
|
||||||
|
console.log("Cleaning up expired sessions: ", result.changes);
|
||||||
|
}, 60 * 60 * 1000);
|
||||||
|
|
||||||
export default sessionParser;
|
export default sessionParser;
|
||||||
|
|
Loading…
Add table
Reference in a new issue