-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to reserve big amount of links #315
Comments
Note: I currently work on https://github.com/deep-foundation/russian-laws and have this problem. I guess as workaround I need to call reserve multiple times instead of one. Is this related to timeout? I do not see clear error. Can I change timeout? |
@FreePhoenix888 did you created a test in |
not yet |
I tried to reserve 20 000 links by calling reserve a lot of times to reserve 500 links. After reserving 500 links four times (totally reserved 2000) I get "http exception when calling webhook" |
Workaround 1Chunk reversed links with less then 500 links. |
Even if we do it in parallel we still get this error: async function reserveItemsInBatches({
totalItems,
batchSize,
}: {
totalItems: number;
batchSize: number;
}) {
const reservedIds = [];
const numBatches = Math.ceil(totalItems / batchSize);
const batchPromises = [];
for (let i = 0; i < numBatches; i++) {
const batch = Math.min(batchSize, totalItems - i * batchSize);
batchPromises.push(deep.reserve(batch));
}
const batchResults = await Promise.all(batchPromises);
batchResults.forEach(reserved => {
reservedIds.push(...reserved);
log(`Reserved ${reservedIds.length} / ${totalItems}`);
});
return reservedIds;
}
const reservedIds = await reserveItemsInBatches({
totalItems: linksNumberToReserve,
batchSize: 100,
}); |
How to reproduce
Error
The text was updated successfully, but these errors were encountered: