@travetto/model-redis 6.0.0 → 6.0.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@travetto/model-redis",
3
- "version": "6.0.0",
3
+ "version": "6.0.1",
4
4
  "description": "Redis backing for the travetto model module.",
5
5
  "keywords": [
6
6
  "typescript",
@@ -25,10 +25,10 @@
25
25
  "directory": "module/model-redis"
26
26
  },
27
27
  "dependencies": {
28
- "@travetto/cli": "^6.0.0",
29
- "@travetto/config": "^6.0.0",
30
- "@travetto/model": "^6.0.0",
31
- "redis": "^4.7.0"
28
+ "@redis/client": "^5.8.3",
29
+ "@travetto/cli": "^6.0.1",
30
+ "@travetto/config": "^6.0.1",
31
+ "@travetto/model": "^6.0.1"
32
32
  },
33
33
  "travetto": {
34
34
  "displayName": "Redis Model Support"
package/src/service.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { createClient } from 'redis';
1
+ import { createClient } from '@redis/client';
2
2
 
3
3
  import { ShutdownManager, type Class, type DeepPartial } from '@travetto/runtime';
4
4
  import {
@@ -41,7 +41,7 @@ export class RedisModelService implements ModelCrudSupport, ModelExpirySupport,
41
41
  }
42
42
 
43
43
  async * #streamValues(op: 'scan' | 'sScan' | 'zScan', search: RedisScan, count = 100): AsyncIterable<string[]> {
44
- let prevCursor = 0;
44
+ let prevCursor = '0';
45
45
  let done = false;
46
46
 
47
47
  const flags = { COUNT: count, ...('match' in search ? { MATCH: search.match } : {}) };
@@ -60,7 +60,7 @@ export class RedisModelService implements ModelCrudSupport, ModelExpirySupport,
60
60
 
61
61
  yield results;
62
62
 
63
- if (cursor === 0) {
63
+ if (cursor === '0') {
64
64
  done = true;
65
65
  }
66
66
  }
@@ -171,7 +171,7 @@ export class RedisModelService implements ModelCrudSupport, ModelExpirySupport,
171
171
  this.client = createClient(this.config.client);
172
172
  await this.client.connect();
173
173
  await ModelStorageUtil.registerModelChangeListener(this);
174
- ShutdownManager.onGracefulShutdown(() => this.client.disconnect(), this);
174
+ ShutdownManager.onGracefulShutdown(() => this.client.destroy());
175
175
  for (const el of ModelRegistry.getClasses()) {
176
176
  for (const idx of ModelRegistry.get(el).indices ?? []) {
177
177
  switch (idx.type) {
@@ -1,6 +1,6 @@
1
1
  import type { ServiceDescriptor } from '@travetto/cli';
2
2
 
3
- const version = process.env.REDIS_VERSION || '7.4';
3
+ const version = process.env.REDIS_VERSION || '8.0';
4
4
 
5
5
  export const service: ServiceDescriptor = {
6
6
  name: 'redis',