@trieb.work/nextjs-turbo-redis-cache 1.7.1 → 1.8.0-beta.2
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/CHANGELOG.md +96 -101
- package/README.md +20 -15
- package/dist/index.d.mts +7 -1
- package/dist/index.d.ts +7 -1
- package/dist/index.js +399 -267
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +399 -267
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/RedisStringsHandler.ts +522 -358
- package/src/SyncedMap.ts +11 -6
package/src/SyncedMap.ts
CHANGED
|
@@ -202,7 +202,11 @@ export class SyncedMap<V> {
|
|
|
202
202
|
|
|
203
203
|
try {
|
|
204
204
|
await this.subscriberClient.connect().catch(async () => {
|
|
205
|
-
|
|
205
|
+
console.error('Failed to connect subscriber client. Retrying...');
|
|
206
|
+
await this.subscriberClient.connect().catch((error) => {
|
|
207
|
+
console.error('Failed to connect subscriber client.', error);
|
|
208
|
+
throw error;
|
|
209
|
+
});
|
|
206
210
|
});
|
|
207
211
|
|
|
208
212
|
// Check if keyspace event configuration is set correctly
|
|
@@ -214,7 +218,9 @@ export class SyncedMap<V> {
|
|
|
214
218
|
)?.['notify-keyspace-events'];
|
|
215
219
|
if (!keyspaceEventConfig.includes('E')) {
|
|
216
220
|
throw new Error(
|
|
217
|
-
|
|
221
|
+
'Keyspace event configuration is set to "' +
|
|
222
|
+
keyspaceEventConfig +
|
|
223
|
+
"\" but has to include 'E' for Keyevent events, published with __keyevent@<db>__ prefix. We recommend to set it to 'Exe' like so `redis-cli -h localhost config set notify-keyspace-events Exe`",
|
|
218
224
|
);
|
|
219
225
|
}
|
|
220
226
|
if (
|
|
@@ -225,7 +231,9 @@ export class SyncedMap<V> {
|
|
|
225
231
|
)
|
|
226
232
|
) {
|
|
227
233
|
throw new Error(
|
|
228
|
-
|
|
234
|
+
'Keyspace event configuration is set to "' +
|
|
235
|
+
keyspaceEventConfig +
|
|
236
|
+
"\" but has to include 'A' or 'x' and 'e' for expired and evicted events. We recommend to set it to 'Exe' like so `redis-cli -h localhost config set notify-keyspace-events Exe`",
|
|
229
237
|
);
|
|
230
238
|
}
|
|
231
239
|
}
|
|
@@ -316,9 +324,6 @@ export class SyncedMap<V> {
|
|
|
316
324
|
await Promise.all(operations);
|
|
317
325
|
}
|
|
318
326
|
|
|
319
|
-
// /api/revalidated-fetch
|
|
320
|
-
// true
|
|
321
|
-
|
|
322
327
|
public async delete(
|
|
323
328
|
keys: string[] | string,
|
|
324
329
|
withoutSyncMessage = false,
|