From cb79b38c9d870af2979dea1e6e54b37271b217ff Mon Sep 17 00:00:00 2001 From: cgeek <cem.moreau@gmail.com> Date: Thu, 3 Aug 2017 22:14:40 +0200 Subject: [PATCH] [fix] #1023 Remove "wotb maintenance" old code --- app/lib/dal/fileDAL.ts | 7 ------- app/lib/dal/sqliteDAL/index/IIndexDAL.ts | 6 ------ 2 files changed, 13 deletions(-) diff --git a/app/lib/dal/fileDAL.ts b/app/lib/dal/fileDAL.ts index 3e2068b97..ff7fbc21d 100644 --- a/app/lib/dal/fileDAL.ts +++ b/app/lib/dal/fileDAL.ts @@ -110,13 +110,6 @@ export class FileDAL { } logger.debug("Upgrade database..."); await this.metaDAL.upgradeDatabase(conf); - const latestMember = await this.iindexDAL.getLatestMember(); - if (latestMember && this.wotb.getWoTSize() > latestMember.wotb_id + 1) { - logger.warn('Maintenance: cleaning wotb...'); - while (this.wotb.getWoTSize() > latestMember.wotb_id + 1) { - this.wotb.removeNode(); - } - } // Update the maximum certifications count a member can issue into the C++ addon const currencyParams = await this.getParameters(); if (currencyParams && currencyParams.sigStock !== undefined && currencyParams.sigStock !== null) { diff --git a/app/lib/dal/sqliteDAL/index/IIndexDAL.ts b/app/lib/dal/sqliteDAL/index/IIndexDAL.ts index 813e34f67..7d9c9ae8c 100644 --- a/app/lib/dal/sqliteDAL/index/IIndexDAL.ts +++ b/app/lib/dal/sqliteDAL/index/IIndexDAL.ts @@ -89,12 +89,6 @@ export class IIndexDAL extends AbstractIndex<IindexEntry> { ')') } - async getLatestMember() { - const res:any = (await this.query('SELECT MAX(wotb_id) as max_wotb_id FROM ' + this.table))[0] - const max_wotb_id = res.max_wotb_id - return this.entityOrNull('wotb_id', max_wotb_id) - } - async getToBeKickedPubkeys() { // All those who has been subject to, or who are currently subject to kicking. Make one result per pubkey. const reducables = Indexer.DUP_HELPERS.reduceBy(await this.sqlFind({ kick: true }), ['pub']); -- GitLab