[PR #3311] [MERGED] Backup restore clear cache #3929

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

📋 Pull Request Information

Original PR: https://github.com/advplyr/audiobookshelf/pull/3311
Author: @nichwall
Created: 8/20/2024
Status: Merged
Merged: 8/22/2024
Merged by: @advplyr

Base: masterHead: backup_restore_clear_cache


📝 Commits (3)

  • 8be0888 Update formatting in CacheManager
  • ccdc3d6 Change: CacheManager use ensureDir
  • 996c78d Add: clear metadata cache when restoring backup

📊 Changes

2 files changed (+27 additions, -28 deletions)

View changed files

📝 server/managers/BackupManager.js (+4 -0)
📝 server/managers/CacheManager.js (+23 -28)

📄 Description

Fixes https://github.com/advplyr/audiobookshelf/issues/3272

This PR purges the entire cache in /metadata/cache after restoring from a backup. The main reasoning for this is that backups may have different images or be done when migrating to a new server, so the cache should be cleared regardless.

I also updated the CacheManager to use ensureDir to be a little more readable.


🔄 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/3311 **Author:** [@nichwall](https://github.com/nichwall) **Created:** 8/20/2024 **Status:** ✅ Merged **Merged:** 8/22/2024 **Merged by:** [@advplyr](https://github.com/advplyr) **Base:** `master` ← **Head:** `backup_restore_clear_cache` --- ### 📝 Commits (3) - [`8be0888`](https://github.com/advplyr/audiobookshelf/commit/8be08882d88676b5abc67a80bc169dd63e42668b) Update formatting in CacheManager - [`ccdc3d6`](https://github.com/advplyr/audiobookshelf/commit/ccdc3d60c444d0526d3b31d9e28d73536925ec91) Change: CacheManager use ensureDir - [`996c78d`](https://github.com/advplyr/audiobookshelf/commit/996c78d760b25574711930cada06bf2b20b75f2d) Add: clear metadata cache when restoring backup ### 📊 Changes **2 files changed** (+27 additions, -28 deletions) <details> <summary>View changed files</summary> 📝 `server/managers/BackupManager.js` (+4 -0) 📝 `server/managers/CacheManager.js` (+23 -28) </details> ### 📄 Description Fixes https://github.com/advplyr/audiobookshelf/issues/3272 This PR purges the entire cache in `/metadata/cache` after restoring from a backup. The main reasoning for this is that backups may have different images or be done when migrating to a new server, so the cache should be cleared regardless. I also updated the `CacheManager` to use `ensureDir` to be a little more readable. --- <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:36 +02:00
adam closed this issue 2026-04-25 00:17:36 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/audiobookshelf#3929