mirror of
https://github.com/zadam/trilium.git
synced 2025-11-01 02:45:54 +01:00
feat(server/session): clean up expired sessions
This commit is contained in:
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user