Skip to content

Commit b7f2d4c

Browse files
committed
refactor: 优化 getCache 方法中的缓存获取逻辑
1 parent 4843c45 commit b7f2d4c

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

src/class/GEOResourceManifest.mjs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,8 @@ export default class GEOResourceManifest {
3535
Console.error("Get Cache", "Missing query string");
3636
return undefined;
3737
}
38-
let cache;
39-
if (KV) {
40-
cache = await KV.getItem(`@iRingo.Maps.Caches.${queryString}`);
41-
if (typeof cache === "object" && cache !== null) caches[queryString] = cache;
42-
} else cache = caches?.[queryString];
38+
let cache = caches?.[queryString];
39+
if (KV) cache = await KV.getItem(`@iRingo.Maps.Caches.${queryString}`);
4340
switch (typeof cache?.base64) {
4441
case "string":
4542
if (cache.base64) {

0 commit comments

Comments
 (0)