From 3f96832410d81be04f86fe742caa0ae5bbf955c1 Mon Sep 17 00:00:00 2001 From: Nguyen Sy Thanh Son Date: Thu, 27 Dec 2018 09:11:20 +0000 Subject: [PATCH 1/2] info log in mainnet --- config/mainnet.json | 2 +- config/mainnet_crawler.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/config/mainnet.json b/config/mainnet.json index eb96791c..27bd3b5b 100644 --- a/config/mainnet.json +++ b/config/mainnet.json @@ -1,6 +1,6 @@ { "logs": { - "level": "warn" + "level": "info" }, "blockchain": { "rpc": "https://rpc.tomochain.com", diff --git a/config/mainnet_crawler.json b/config/mainnet_crawler.json index 3a49ffcb..e8588661 100644 --- a/config/mainnet_crawler.json +++ b/config/mainnet_crawler.json @@ -1,6 +1,6 @@ { "logs": { - "level": "warn" + "level": "info" }, "blockchain": { "rpc": "http://blockchain-proxy:8545", From 764d216da9d65f91ec7b478785f4cab00e261ebd Mon Sep 17 00:00:00 2001 From: Nguyen Sy Thanh Son Date: Thu, 27 Dec 2018 10:45:47 +0000 Subject: [PATCH 2/2] change speed of crawl --- crawl.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/crawl.js b/crawl.js index 7f2d429e..1915315c 100644 --- a/crawl.js +++ b/crawl.js @@ -250,17 +250,21 @@ async function updateSigners () { let sleep = (time) => new Promise((resolve) => setTimeout(resolve, time)) async function watchNewBlock () { + let b = true while (true) { try { - logger.info('Update signers after sleeping 5 seconds') - await updateSigners() - await updatePenalties() + logger.info('Update signers after sleeping 3 seconds') + if (b) { + await updateSigners() + await updatePenalties() + } await updateLatestSignedBlock() await watchValidator() + b = !b } catch (e) { logger.error('watchNewBlock %s', e) } - await sleep(5000) + await sleep(3000) } }