@trieb.work/nextjs-turbo-redis-cache 1.7.0 → 1.8.0-beta.1

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/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
- await this.subscriberClient.connect();
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
- "Keyspace event configuration 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`",
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
- "Keyspace event configuration 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`",
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,