From f095fc285458106d1ec3df6dfde78714d4590d66 Mon Sep 17 00:00:00 2001 From: librelois <elois@ifee.fr> Date: Sun, 17 Sep 2017 01:39:39 +0200 Subject: [PATCH] [enh] export indexing task to module --- index.js | 5 ++--- lib/indexing.js | 6 ++++++ 2 files changed, 8 insertions(+), 3 deletions(-) create mode 100644 lib/indexing.js diff --git a/index.js b/index.js index 72b0268..5023a27 100755 --- a/index.js +++ b/index.js @@ -4,7 +4,7 @@ const co = require('co'); const fs = require('fs'); const path = require('path'); const main = require(__dirname + '/lib/main.js'); -//const duniter = require('duniter'); +const indexing = require(__dirname + '/lib/indexing.js'); /**************************************** * TECHNICAL CONFIGURATION @@ -74,8 +74,7 @@ module.exports = { else if (ACTION == "indexing") { try { - console.log('sync...'); - console.log('ok'); + indexing(server, conf, program, params); } catch (err) { console.error('Error during blockchain indexing ', err); } diff --git a/lib/indexing.js b/lib/indexing.js new file mode 100644 index 0000000..c958ad2 --- /dev/null +++ b/lib/indexing.js @@ -0,0 +1,6 @@ +module.exports = function timestampToDatetime(server, conf, program, params) { + + console.log('sync...'); + console.log('ok'); + +} -- GitLab