Commit 71e2d7c7 authored by Cédric Moreau's avatar Cédric Moreau

[fix] WW: still missing (a lot of) blocks for certifications

parent de4a0e0a
Pipeline #4987 failed with stages
in 13 minutes and 21 seconds
......@@ -97,6 +97,12 @@ module.exports = {
// Save DB
await server.disconnect();
}
}, {
name: 'dump-ww',
desc: 'Dumps WotWizard export.',
logs: true,
preventIfRunning: true,
onDatabaseExecute: async (server:Server) => dumpWotWizard(server)
}]
}
}
......
......@@ -42,8 +42,8 @@ export function requiredBlocksAccumulator(server: Server, wwDAL: WotWizardDAL):
const numbers = Object.keys(blockNumbers).map(n => parseInt(n))
const blocksForCertifications: (DBBlock|null)[] = []
for (let i = 0; i < numbers.length; i += chunkLen) {
const chunk = numbers.slice(0, chunkLen + 1)
logger.debug('Chunk %s-%s', i, i + chunkLen)
const chunk = numbers.slice(i, i + chunkLen)
logger.debug('Chunk %s-%s', chunk[0], chunk[chunk.length - 1])
;(await Promise.all(chunk.map(n => server.dal.getBlock(n))))
.forEach(b => blocksForCertifications.push(b))
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment