From e869df2f7da1df128017204f5590babcc464e520 Mon Sep 17 00:00:00 2001 From: cgeek <cem.moreau@gmail.com> Date: Mon, 20 Apr 2020 22:36:32 +0200 Subject: [PATCH] [enh] add `reindex` command --- index.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 769d3aa..742b53d 100755 --- a/index.js +++ b/index.js @@ -5,6 +5,7 @@ const fs = require('fs'); const path = require('path'); const main = require(__dirname + '/lib/main.js'); const indexing = require(__dirname + '/lib/indexing.js'); +const initMonitDB = require('./lib/DataFinder').initMonitDB; /**************************************** * TECHNICAL CONFIGURATION @@ -52,7 +53,7 @@ module.exports = { preventIfRunning: true, logs: false, onDatabaseExecute: (server, conf, program, params, startServices) => co(function*() { - + // currency-monit parameters const ACTION = params[0] || DEFAULT_ACTION; const SERVER_HOST = params[1] || DEFAULT_HOST; @@ -86,6 +87,14 @@ module.exports = { return server && server.disconnect() } }) + }, { + name: 'reindex', + desc: 'Reset indexed Monit data and rebuild index', + preventIfRunning: true, + logs: false, + async onDatabaseExecute(server, conf, program, params, startServices) { + await initMonitDB(server, true); + } }] }, duniterUI: { -- GitLab