[PR #3332] [MERGED] memorystore: simplify, refactor, re-enable #3940

Closed
opened 2026-04-25 00:17:39 +02:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/advplyr/audiobookshelf/pull/3332
Author: @itzexor
Created: 8/25/2024
Status: Merged
Merged: 8/27/2024
Merged by: @advplyr

Base: masterHead: memorystore-2


📝 Commits (2)

  • ec197b2 memorystore: simplify, refactor, re-enable
  • 9b35530 Fix memorystore constructor validation

📊 Changes

2 files changed (+58 additions, -241 deletions)

View changed files

📝 server/Server.js (+3 -1)
📝 server/libs/memorystore/index.js (+55 -240)

📄 Description

Removes a lot of unused (in ABS) functionality, refactors to ES6 style class, and re-enables this custom implementation with check period and ttl of 1 day, and 1000 max entries.

The class now only implents the required (as per express-session docs) methods and removes optional methods, except touch() which allows the TTL of an entry to be refreshed without affecting its LRU recency.

There is no longer a way to stop the prune timer, but I don't believe the function was ever being called beforehand. The session store's lifetime is the same as the application's, and since it is unref()'d should not cause any shutdown issues.

ref: https://github.com/advplyr/audiobookshelf/issues/3251
fixes: https://github.com/advplyr/audiobookshelf/issues/2538


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/advplyr/audiobookshelf/pull/3332 **Author:** [@itzexor](https://github.com/itzexor) **Created:** 8/25/2024 **Status:** ✅ Merged **Merged:** 8/27/2024 **Merged by:** [@advplyr](https://github.com/advplyr) **Base:** `master` ← **Head:** `memorystore-2` --- ### 📝 Commits (2) - [`ec197b2`](https://github.com/advplyr/audiobookshelf/commit/ec197b2e133594013ad18efb47dafeba1b07f4ea) memorystore: simplify, refactor, re-enable - [`9b35530`](https://github.com/advplyr/audiobookshelf/commit/9b3553095683dcd15a983966d7347d8f2d6c8815) Fix memorystore constructor validation ### 📊 Changes **2 files changed** (+58 additions, -241 deletions) <details> <summary>View changed files</summary> 📝 `server/Server.js` (+3 -1) 📝 `server/libs/memorystore/index.js` (+55 -240) </details> ### 📄 Description Removes a lot of unused (in ABS) functionality, refactors to ES6 style class, and re-enables this custom implementation with check period and ttl of 1 day, and 1000 max entries. The class now only implents the required (as per express-session docs) methods and removes optional methods, except touch() which allows the TTL of an entry to be refreshed without affecting its LRU recency. There is no longer a way to stop the prune timer, but I don't believe the function was ever being called beforehand. The session store's lifetime is the same as the application's, and since it is unref()'d should not cause any shutdown issues. ref: https://github.com/advplyr/audiobookshelf/issues/3251 fixes: https://github.com/advplyr/audiobookshelf/issues/2538 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2026-04-25 00:17:39 +02:00
adam closed this issue 2026-04-25 00:17:39 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#3940