fix: remove cache.has function
This commit is contained in:
parent
2fa46d65ae
commit
c61054990b
@ -24,10 +24,6 @@ export function get(id: string) {
|
||||
return cache.get(id);
|
||||
}
|
||||
|
||||
export function has(id: string) {
|
||||
return cache.has(id);
|
||||
}
|
||||
|
||||
export function set(id: string, content: any) {
|
||||
return cache.set(id, content);
|
||||
}
|
||||
|
@ -108,8 +108,9 @@ export const handler = async (
|
||||
}
|
||||
|
||||
const imageId = `${imageUrl}.${params.width}.${params.height}`;
|
||||
if (await cache.has(imageId)) {
|
||||
return (await (await cache.get(imageId)!)).clone();
|
||||
const cachedResponse = await cache.get(imageId);
|
||||
if (cachedResponse) {
|
||||
return (await cachedResponse).clone();
|
||||
}
|
||||
|
||||
const remoteImage = await getRemoteImage(imageUrl);
|
||||
|
Loading…
x
Reference in New Issue
Block a user