Skip to content
This repository was archived by the owner on Jun 25, 2025. It is now read-only.
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ module.exports = ({ Store }) => {
intervalMs:
(options.expired && options.expired.intervalMs) ||
clearExpiredInterval,
unrefInterval: (options.expired && options.expired.unrefInterval) ||
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we'd have to add any new option property to the documentation. And why do we need "|| false" ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I will add it to the docs if you accept it to be added. Regarding the "false", that's redundant of course and I'll remove it.

false,
};
this.client = options.client;
this.createDb();
Expand All @@ -40,10 +42,13 @@ module.exports = ({ Store }) => {
}

startInterval() {
setInterval(
const timeout = setInterval(
this.clearExpiredSessions.bind(this),
this.expired.intervalMs
);
if (this.expired.unrefInterval) {
timeout.unref();
}
}

clearExpiredSessions() {
Expand Down