diff --git a/app/modules/dump.ts b/app/modules/dump.ts index d89ebb7475c5bb579d1ef7b587f26e85ed959653..ea01d58832e61980f7a91738a6f30c1fe0d3ed6f 100644 --- a/app/modules/dump.ts +++ b/app/modules/dump.ts @@ -41,6 +41,7 @@ import { } from "../lib/dto/CertificationDTO"; import { MembershipDTO } from "../lib/dto/MembershipDTO"; import { RevocationDTO, ShortRevocation } from "../lib/dto/RevocationDTO"; +import { NewLogger } from "../lib/logger"; const Table = require("cli-table"); @@ -156,6 +157,7 @@ module.exports = { break; case "wotwizard": + NewLogger().unmute(); await dumpWotWizard(server); break; diff --git a/app/modules/dump/wotwizard/wotwizard.dump.ts b/app/modules/dump/wotwizard/wotwizard.dump.ts index 35ce2cf4fdef6c38767df176c9eaee8fe315750b..f6df40e4366b33e2006205be99ba49167a3b7b12 100644 --- a/app/modules/dump/wotwizard/wotwizard.dump.ts +++ b/app/modules/dump/wotwizard/wotwizard.dump.ts @@ -53,6 +53,6 @@ export async function dumpWotWizard(server: Server) { Directory.GET_FILE_PATH(WotWizardConstants.DB_NAME_0), Directory.GET_FILE_PATH(WotWizardConstants.DB_NAME) ); - fs.writeFileSync(updatingFile, Date.now()); + fs.writeFileSync(updatingFile, String(Date.now())); } } diff --git a/app/modules/dump/wotwizard/wotwizard.legacy.blocks.ts b/app/modules/dump/wotwizard/wotwizard.legacy.blocks.ts index 86025ac294165a0044643e20b188c5a362a365b7..e548b76a0327af6cffaea97f108704fe2df215f2 100644 --- a/app/modules/dump/wotwizard/wotwizard.legacy.blocks.ts +++ b/app/modules/dump/wotwizard/wotwizard.legacy.blocks.ts @@ -26,8 +26,12 @@ export async function addLegacyBlocks(server: Server, wwDAL: WotWizardDAL) { return f; }); legacies.forEach((l) => blocksSaved.push(l)); - if (i % 25000 === 0) { - logger.debug("Saving 25 blocks... (%s yet stored)", i); + if (i % CommonConstants.BLOCKS_IN_MEMORY_MAX === 0) { + logger.debug( + "Saving %s blocks... (%s yet stored)", + CommonConstants.BLOCKS_IN_MEMORY_MAX, + i + ); await wwDAL.blockDao.insertBatch(blocksSaved); blocksSaved = []; }