ag-common 0.0.346 → 0.0.347
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/dist/api/helpers/dynamo.js +12 -6
- package/package.json +1 -1
|
@@ -320,15 +320,21 @@ const wipeTable = (tableName) => __awaiter(void 0, void 0, void 0, function* ()
|
|
|
320
320
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
321
321
|
// @ts-ignore
|
|
322
322
|
let keyHash = infoV.Table.KeySchema.find((k) => k.KeyType === 'HASH').AttributeName;
|
|
323
|
-
|
|
324
|
-
.scan({
|
|
323
|
+
const params = {
|
|
325
324
|
TableName: tableName,
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
325
|
+
ExclusiveStartKey: undefined,
|
|
326
|
+
};
|
|
327
|
+
let all = [];
|
|
328
|
+
let working;
|
|
329
|
+
do {
|
|
330
|
+
working = yield dbRaw.scan(params).promise();
|
|
331
|
+
(_h = working.Items) === null || _h === void 0 ? void 0 : _h.forEach((item) => all.push(item));
|
|
332
|
+
params.ExclusiveStartKey = working.LastEvaluatedKey;
|
|
333
|
+
} while (typeof working.LastEvaluatedKey !== 'undefined');
|
|
334
|
+
(0, log_1.warn)(`will delete ${all === null || all === void 0 ? void 0 : all.length} items from ${tableName}`);
|
|
329
335
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
330
336
|
// @ts-ignore
|
|
331
|
-
const datagr = (0, array_1.chunk)(all
|
|
337
|
+
const datagr = (0, array_1.chunk)(all, 25);
|
|
332
338
|
let res = yield Promise.all(datagr.map((group) => dbRaw
|
|
333
339
|
.batchWriteItem({
|
|
334
340
|
RequestItems: {
|