feat: refresh in libraries and books lists
This commit is contained in:
@@ -283,6 +283,24 @@ class ServerCacheService {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Supprime toutes les entrées du cache qui commencent par un préfixe
|
||||
*/
|
||||
deleteAll(prefix: string): void {
|
||||
if (this.config.mode === "memory") {
|
||||
this.memoryCache.forEach((value, key) => {
|
||||
if (key.startsWith(prefix)) {
|
||||
this.memoryCache.delete(key);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
const cacheDir = path.join(this.cacheDir, prefix);
|
||||
if (fs.existsSync(cacheDir)) {
|
||||
fs.rmdirSync(cacheDir, { recursive: true });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Vide le cache
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user