cache-manager 6.2.0 → 6.3.0
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/README.md +3 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -167,6 +167,9 @@ const cache = createCache({ stores: [keyv] });
|
|
|
167
167
|
- **refreshThreshold**?: number - Default refreshThreshold in milliseconds.
|
|
168
168
|
|
|
169
169
|
If the remaining TTL is less than **refreshThreshold**, the system will update the value asynchronously in background.
|
|
170
|
+
- **refreshAllStores**?: boolean - Default false
|
|
171
|
+
|
|
172
|
+
If set to true, the system will update the value of all stores when the refreshThreshold is met. Otherwise, it will only update from the top to the store that triggered the refresh.
|
|
170
173
|
|
|
171
174
|
- **nonBlocking**?: boolean - Default false
|
|
172
175
|
|
package/dist/index.cjs
CHANGED
|
@@ -302,7 +302,7 @@ var createCache = (options) => {
|
|
|
302
302
|
if (shouldRefresh) {
|
|
303
303
|
coalesceAsync(`+++${key}`, fnc).then(async (result) => {
|
|
304
304
|
try {
|
|
305
|
-
await set(stores.slice(0, i + 1), key, result, ms);
|
|
305
|
+
await set(options?.refreshAllStores ? stores : stores.slice(0, i + 1), key, result, ms);
|
|
306
306
|
eventEmitter.emit("refresh", { key, value: result });
|
|
307
307
|
} catch (error) {
|
|
308
308
|
eventEmitter.emit("refresh", { key, value, error });
|
package/dist/index.d.cts
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -267,7 +267,7 @@ var createCache = (options) => {
|
|
|
267
267
|
if (shouldRefresh) {
|
|
268
268
|
coalesceAsync(`+++${key}`, fnc).then(async (result) => {
|
|
269
269
|
try {
|
|
270
|
-
await set(stores.slice(0, i + 1), key, result, ms);
|
|
270
|
+
await set(options?.refreshAllStores ? stores : stores.slice(0, i + 1), key, result, ms);
|
|
271
271
|
eventEmitter.emit("refresh", { key, value: result });
|
|
272
272
|
} catch (error) {
|
|
273
273
|
eventEmitter.emit("refresh", { key, value, error });
|