Skip to content
Snippets Groups Projects
Commit 71e2d7c7 authored by Cédric Moreau's avatar Cédric Moreau
Browse files

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

parent de4a0e0a
No related branches found
No related tags found
No related merge requests found
...@@ -97,6 +97,12 @@ module.exports = { ...@@ -97,6 +97,12 @@ module.exports = {
// Save DB // Save DB
await server.disconnect(); 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): ...@@ -42,8 +42,8 @@ export function requiredBlocksAccumulator(server: Server, wwDAL: WotWizardDAL):
const numbers = Object.keys(blockNumbers).map(n => parseInt(n)) const numbers = Object.keys(blockNumbers).map(n => parseInt(n))
const blocksForCertifications: (DBBlock|null)[] = [] const blocksForCertifications: (DBBlock|null)[] = []
for (let i = 0; i < numbers.length; i += chunkLen) { for (let i = 0; i < numbers.length; i += chunkLen) {
const chunk = numbers.slice(0, chunkLen + 1) const chunk = numbers.slice(i, i + chunkLen)
logger.debug('Chunk %s-%s', i, i + chunkLen) logger.debug('Chunk %s-%s', chunk[0], chunk[chunk.length - 1])
;(await Promise.all(chunk.map(n => server.dal.getBlock(n)))) ;(await Promise.all(chunk.map(n => server.dal.getBlock(n))))
.forEach(b => blocksForCertifications.push(b)) .forEach(b => blocksForCertifications.push(b))
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment