mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-30 03:32:26 +08:00
feat(server/session): clean up expired sessions
This commit is contained in:
parent
43ab13e126
commit
15a513d7cd
@ -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…
x
Reference in New Issue
Block a user