Breaking after 1000 purges.
This commit is contained in:
parent
19aaaba3f8
commit
01554e3383
|
@ -239,6 +239,7 @@ export const watchDbLegacy = async () => {
|
|||
|
||||
const deletedDocs = await getDeletedDocs();
|
||||
|
||||
let i = 0;
|
||||
if (deletedDocs.length > 0) {
|
||||
console.log({
|
||||
caller: 'watchDbLegacy / purge',
|
||||
|
@ -248,7 +249,6 @@ export const watchDbLegacy = async () => {
|
|||
deletedDocs,
|
||||
state: state(),
|
||||
});
|
||||
let i = 0;
|
||||
for (const doc of deletedDocs) {
|
||||
await sleep(10);
|
||||
try {
|
||||
|
@ -269,12 +269,14 @@ export const watchDbLegacy = async () => {
|
|||
doc,
|
||||
});
|
||||
}
|
||||
if (i === 10000) {
|
||||
if (i === 20000) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (i !== deletedDocs.length) {
|
||||
await sleep(60000);
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue