@travetto/cache 8.0.0-alpha.10 → 8.0.0-alpha.12
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 +5 -5
- package/src/service.ts +3 -6
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@travetto/cache",
|
|
3
|
-
"version": "8.0.0-alpha.
|
|
3
|
+
"version": "8.0.0-alpha.12",
|
|
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.
|
|
30
|
-
"@travetto/model": "^8.0.0-alpha.
|
|
29
|
+
"@travetto/di": "^8.0.0-alpha.11",
|
|
30
|
+
"@travetto/model": "^8.0.0-alpha.11"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
|
-
"@travetto/test": "^8.0.0-alpha.
|
|
34
|
-
"@travetto/transformer": "^8.0.0-alpha.
|
|
33
|
+
"@travetto/test": "^8.0.0-alpha.11",
|
|
34
|
+
"@travetto/transformer": "^8.0.0-alpha.6"
|
|
35
35
|
},
|
|
36
36
|
"peerDependenciesMeta": {
|
|
37
37
|
"@travetto/transformer": {
|
package/src/service.ts
CHANGED
|
@@ -107,14 +107,11 @@ 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
|
-
|
|
111
|
-
|
|
112
|
-
const { items, nextOffset } = await this.#modelService.listByIndex(CacheRecord, keySpaceIndex, { keySpace }, { offset });
|
|
113
|
-
for (const item of items) {
|
|
110
|
+
for await (const batch of this.#modelService.listByIndex(CacheRecord, keySpaceIndex, { keySpace })) {
|
|
111
|
+
for (const item of batch) {
|
|
114
112
|
removes.push(this.#modelService.delete(CacheRecord, item.id));
|
|
115
113
|
}
|
|
116
|
-
|
|
117
|
-
} while (offset);
|
|
114
|
+
}
|
|
118
115
|
await Promise.all(removes);
|
|
119
116
|
} else {
|
|
120
117
|
throw new RuntimeError('Unable to delete all on an un-indexed database');
|