@dnax/core 0.8.19 → 0.8.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/app/hono.ts +8 -6
- package/package.json +1 -1
- package/types/index.ts +1 -1
package/app/hono.ts
CHANGED
|
@@ -431,18 +431,20 @@ function HonoInstance(): typeof app {
|
|
|
431
431
|
// udpateOne
|
|
432
432
|
|
|
433
433
|
if (action == "find") {
|
|
434
|
-
let
|
|
434
|
+
let keyCache = bentoKey({
|
|
435
435
|
data: body,
|
|
436
436
|
query: c.req.query,
|
|
437
437
|
});
|
|
438
438
|
if (useCache) {
|
|
439
|
-
let
|
|
440
|
-
if (
|
|
441
|
-
|
|
439
|
+
let responseFromCache = await cache.get(keyCache);
|
|
440
|
+
if (responseFromCache) {
|
|
441
|
+
response = responseFromCache;
|
|
442
442
|
} else {
|
|
443
443
|
response = await rest.find(collection, body?.params || {});
|
|
444
|
-
await cache.set(
|
|
445
|
-
|
|
444
|
+
await cache.set({
|
|
445
|
+
key: keyCache,
|
|
446
|
+
value: response,
|
|
447
|
+
ttl: col?.cache?.ttl || "1m",
|
|
446
448
|
});
|
|
447
449
|
}
|
|
448
450
|
} else {
|
package/package.json
CHANGED