@knaus94/prisma-extension-cache-manager 1.5.55 → 1.5.61
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/dist/index.js +2 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -94,7 +94,6 @@ async function processUncache(cache, uncacheOption, result) {
|
|
|
94
94
|
if (keysToDelete.length === 0)
|
|
95
95
|
return true;
|
|
96
96
|
try {
|
|
97
|
-
// mdel — это ваш кастомный метод в store для массового удаления ключей.
|
|
98
97
|
await cache.store.mdel(...keysToDelete);
|
|
99
98
|
return true;
|
|
100
99
|
}
|
|
@@ -197,7 +196,7 @@ exports.default = ({ cache, defaultTTL, debug }) => {
|
|
|
197
196
|
ttl = cacheOption.ttl ?? defaultTTL ?? 0;
|
|
198
197
|
// Сохраняем результат в кеш, используя msgpack5
|
|
199
198
|
try {
|
|
200
|
-
await cache.store.
|
|
199
|
+
await cache.store.set(cacheKey, serialize(result), ttl);
|
|
201
200
|
if (debug) {
|
|
202
201
|
console.log("Data cached with key (function):", cacheKey, "encoded:", serialize(result), "decoded:", result);
|
|
203
202
|
}
|
|
@@ -250,7 +249,7 @@ exports.default = ({ cache, defaultTTL, debug }) => {
|
|
|
250
249
|
// 6. Сохраняем результат запроса в кеш
|
|
251
250
|
try {
|
|
252
251
|
const data = serialize(result);
|
|
253
|
-
await cache.store.
|
|
252
|
+
await cache.store.set(cacheKey, data, ttl);
|
|
254
253
|
if (debug) {
|
|
255
254
|
console.log("Data cached with key:", cacheKey, "encoded:", data, "decoded:", result);
|
|
256
255
|
}
|