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);
|
return cache.get(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function has(id: string) {
|
|
||||||
return cache.has(id);
|
|
||||||
}
|
|
||||||
|
|
||||||
export function set(id: string, content: any) {
|
export function set(id: string, content: any) {
|
||||||
return cache.set(id, content);
|
return cache.set(id, content);
|
||||||
}
|
}
|
||||||
|
@ -108,8 +108,9 @@ export const handler = async (
|
|||||||
}
|
}
|
||||||
|
|
||||||
const imageId = `${imageUrl}.${params.width}.${params.height}`;
|
const imageId = `${imageUrl}.${params.width}.${params.height}`;
|
||||||
if (await cache.has(imageId)) {
|
const cachedResponse = await cache.get(imageId);
|
||||||
return (await (await cache.get(imageId)!)).clone();
|
if (cachedResponse) {
|
||||||
|
return (await cachedResponse).clone();
|
||||||
}
|
}
|
||||||
|
|
||||||
const remoteImage = await getRemoteImage(imageUrl);
|
const remoteImage = await getRemoteImage(imageUrl);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user