fix(caching): properly respect ttl for all cache levels
This commit is contained in:
@@ -51,14 +51,18 @@ export class CacheDiskManager extends AbstractCache {
|
||||
);
|
||||
}
|
||||
|
||||
public async checkKeyPresence(keyArg): Promise<boolean> {
|
||||
public async checkKeyPresence(keyArg: string): Promise<boolean> {
|
||||
return plugins.smartfile.fs.isFile(plugins.path.join(this.fsPath, encodeURIComponent(keyArg)));
|
||||
}
|
||||
|
||||
/**
|
||||
* cleans the DiskCache directory
|
||||
*/
|
||||
public async clean() {
|
||||
public async deleteCacheEntryByKey(keyArg: string) {
|
||||
await plugins.smartfile.fs.remove(plugins.path.join(this.fsPath, encodeURIComponent(keyArg)));
|
||||
}
|
||||
|
||||
|
||||
public async cleanOutdated() {}
|
||||
|
||||
public async cleanAll() {
|
||||
if (this.status === 'active') {
|
||||
if (plugins.smartfile.fs.isDirectory(this.fsPath)) {
|
||||
await plugins.smartfile.fs.ensureEmptyDir(this.fsPath);
|
||||
|
Reference in New Issue
Block a user