revert unnecessary delete cache api change

This commit is contained in:
Abhinav 2024-01-11 09:56:18 +05:30
parent f0bfbfc479
commit 2730fc99ca

View file

@ -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;
}