@travetto/cache 8.0.0-alpha.10 → 8.0.0-alpha.11
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 +1 -1
- package/src/service.ts +3 -8
package/package.json
CHANGED
package/src/service.ts
CHANGED
|
@@ -107,14 +107,9 @@ 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
|
-
|
|
113
|
-
for (const item of items) {
|
|
114
|
-
removes.push(this.#modelService.delete(CacheRecord, item.id));
|
|
115
|
-
}
|
|
116
|
-
offset = nextOffset;
|
|
117
|
-
} while (offset);
|
|
110
|
+
for await (const item of this.#modelService.listByIndex(CacheRecord, keySpaceIndex, { keySpace })) {
|
|
111
|
+
removes.push(this.#modelService.delete(CacheRecord, item.id));
|
|
112
|
+
}
|
|
118
113
|
await Promise.all(removes);
|
|
119
114
|
} else {
|
|
120
115
|
throw new RuntimeError('Unable to delete all on an un-indexed database');
|