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();
|
const deletedDocs = await getDeletedDocs();
|
||||||
|
|
||||||
|
let i = 0;
|
||||||
if (deletedDocs.length > 0) {
|
if (deletedDocs.length > 0) {
|
||||||
console.log({
|
console.log({
|
||||||
caller: 'watchDbLegacy / purge',
|
caller: 'watchDbLegacy / purge',
|
||||||
|
@ -248,7 +249,6 @@ export const watchDbLegacy = async () => {
|
||||||
deletedDocs,
|
deletedDocs,
|
||||||
state: state(),
|
state: state(),
|
||||||
});
|
});
|
||||||
let i = 0;
|
|
||||||
for (const doc of deletedDocs) {
|
for (const doc of deletedDocs) {
|
||||||
await sleep(10);
|
await sleep(10);
|
||||||
try {
|
try {
|
||||||
|
@ -269,12 +269,14 @@ export const watchDbLegacy = async () => {
|
||||||
doc,
|
doc,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (i === 10000) {
|
if (i === 20000) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
await sleep(60000);
|
if (i !== deletedDocs.length) {
|
||||||
|
await sleep(60000);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue