@travetto/cache 8.0.0-alpha.11 → 8.0.0-alpha.13

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.
Files changed (2) hide show
  1. package/package.json +5 -5
  2. package/src/service.ts +4 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@travetto/cache",
3
- "version": "8.0.0-alpha.11",
3
+ "version": "8.0.0-alpha.13",
4
4
  "type": "module",
5
5
  "description": "Caching functionality with decorators for declarative use.",
6
6
  "keywords": [
@@ -26,12 +26,12 @@
26
26
  "directory": "module/cache"
27
27
  },
28
28
  "dependencies": {
29
- "@travetto/di": "^8.0.0-alpha.10",
30
- "@travetto/model": "^8.0.0-alpha.10"
29
+ "@travetto/di": "^8.0.0-alpha.11",
30
+ "@travetto/model": "^8.0.0-alpha.12"
31
31
  },
32
32
  "peerDependencies": {
33
- "@travetto/test": "^8.0.0-alpha.10",
34
- "@travetto/transformer": "^8.0.0-alpha.5"
33
+ "@travetto/test": "^8.0.0-alpha.11",
34
+ "@travetto/transformer": "^8.0.0-alpha.7"
35
35
  },
36
36
  "peerDependenciesMeta": {
37
37
  "@travetto/transformer": {
package/src/service.ts CHANGED
@@ -107,8 +107,10 @@ export class CacheService {
107
107
  async deleteAll(keySpace: string): Promise<void> {
108
108
  if (ModelIndexedUtil.isSupported(this.#modelService)) {
109
109
  const removes: Promise<void>[] = [];
110
- for await (const item of this.#modelService.listByIndex(CacheRecord, keySpaceIndex, { keySpace })) {
111
- removes.push(this.#modelService.delete(CacheRecord, item.id));
110
+ for await (const batch of this.#modelService.listByIndex(CacheRecord, keySpaceIndex, { keySpace })) {
111
+ for (const item of batch) {
112
+ removes.push(this.#modelService.delete(CacheRecord, item.id));
113
+ }
112
114
  }
113
115
  await Promise.all(removes);
114
116
  } else {