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

[fix] #1023 Remove "wotb maintenance" old code

parent 4c3816df
No related branches found
No related tags found
No related merge requests found
...@@ -110,13 +110,6 @@ export class FileDAL { ...@@ -110,13 +110,6 @@ export class FileDAL {
} }
logger.debug("Upgrade database..."); logger.debug("Upgrade database...");
await this.metaDAL.upgradeDatabase(conf); 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 // Update the maximum certifications count a member can issue into the C++ addon
const currencyParams = await this.getParameters(); const currencyParams = await this.getParameters();
if (currencyParams && currencyParams.sigStock !== undefined && currencyParams.sigStock !== null) { if (currencyParams && currencyParams.sigStock !== undefined && currencyParams.sigStock !== null) {
......
...@@ -89,12 +89,6 @@ export class IIndexDAL extends AbstractIndex<IindexEntry> { ...@@ -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() { async getToBeKickedPubkeys() {
// All those who has been subject to, or who are currently subject to kicking. Make one result per pubkey. // 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']); const reducables = Indexer.DUP_HELPERS.reduceBy(await this.sqlFind({ kick: true }), ['pub']);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment