Round batch sizes up
This commit is contained in:
parent
6454892d48
commit
20f61fc6a0
@ -480,7 +480,7 @@ class RbfCache {
|
|||||||
};
|
};
|
||||||
|
|
||||||
if (config.MEMPOOL.BACKEND === 'esplora') {
|
if (config.MEMPOOL.BACKEND === 'esplora') {
|
||||||
const sliceLength = Math.floor(config.ESPLORA.BATCH_QUERY_BASE_SIZE / 40);
|
const sliceLength = Math.ceil(config.ESPLORA.BATCH_QUERY_BASE_SIZE / 40);
|
||||||
for (let i = 0; i < Math.ceil(txids.length / sliceLength); i++) {
|
for (let i = 0; i < Math.ceil(txids.length / sliceLength); i++) {
|
||||||
const slice = txids.slice(i * sliceLength, (i + 1) * sliceLength);
|
const slice = txids.slice(i * sliceLength, (i + 1) * sliceLength);
|
||||||
try {
|
try {
|
||||||
|
@ -79,7 +79,7 @@ class ForensicsService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let progress = 0;
|
let progress = 0;
|
||||||
const sliceLength = Math.floor(config.ESPLORA.BATCH_QUERY_BASE_SIZE / 10);
|
const sliceLength = Math.ceil(config.ESPLORA.BATCH_QUERY_BASE_SIZE / 10);
|
||||||
// process batches of 1000 channels
|
// process batches of 1000 channels
|
||||||
for (let i = 0; i < Math.ceil(allChannels.length / sliceLength); i++) {
|
for (let i = 0; i < Math.ceil(allChannels.length / sliceLength); i++) {
|
||||||
const channels = allChannels.slice(i * sliceLength, (i + 1) * sliceLength);
|
const channels = allChannels.slice(i * sliceLength, (i + 1) * sliceLength);
|
||||||
|
@ -290,7 +290,7 @@ class NetworkSyncService {
|
|||||||
|
|
||||||
const allChannels = await channelsApi.$getChannelsByStatus([0, 1]);
|
const allChannels = await channelsApi.$getChannelsByStatus([0, 1]);
|
||||||
|
|
||||||
const sliceLength = Math.floor(config.ESPLORA.BATCH_QUERY_BASE_SIZE / 2);
|
const sliceLength = Math.ceil(config.ESPLORA.BATCH_QUERY_BASE_SIZE / 2);
|
||||||
// process batches of 5000 channels
|
// process batches of 5000 channels
|
||||||
for (let i = 0; i < Math.ceil(allChannels.length / sliceLength); i++) {
|
for (let i = 0; i < Math.ceil(allChannels.length / sliceLength); i++) {
|
||||||
const channels = allChannels.slice(i * sliceLength, (i + 1) * sliceLength);
|
const channels = allChannels.slice(i * sliceLength, (i + 1) * sliceLength);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user