revert unnecessary delete cache api change
This commit is contained in:
parent
f0bfbfc479
commit
2730fc99ca
1 changed files with 2 additions and 11 deletions
|
@ -72,17 +72,8 @@ export class DiskCache implements LimitedCache {
|
|||
async delete(cacheKey: string): Promise<boolean> {
|
||||
const cachePath = path.join(this.cacheBucketDir, cacheKey);
|
||||
if (existsSync(cachePath)) {
|
||||
try {
|
||||
await unlink(cachePath);
|
||||
return true;
|
||||
} catch (e) {
|
||||
if (e.code === 'ENOENT') {
|
||||
return true;
|
||||
} else {
|
||||
logError(e, 'Failed to delete cache key');
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
await unlink(cachePath);
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue