From eaaceac493c6d5c3f4aca97eac401b9cad393293 Mon Sep 17 00:00:00 2001 From: Michael Vines Date: Mon, 29 Apr 2019 08:35:18 -0700 Subject: [PATCH] fix: switch to setTimeout() to avoid running updates concurrently --- src/App.js | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/App.js b/src/App.js index e562e64e..9a2a5814 100755 --- a/src/App.js +++ b/src/App.js @@ -180,15 +180,7 @@ class App extends Component { const self = this; self.updateGlobalStats(); - setInterval(() => { - self.updateGlobalStats(); - }, 1200); - self.updateTxnStats(); - setInterval(() => { - self.updateTxnStats(); - }, 22000); - self.updateBlocks(); self.updateTransactions(); @@ -268,6 +260,8 @@ class App extends Component { this.setState({nodes: []}); console.log('getClusterNodes failed:', err.message); } + + setTimeout(() => this.updateGlobalStats(), 1200); } updateTxnStats() { @@ -275,6 +269,7 @@ class App extends Component { 'txnStats', `http:${BLOCK_EXPLORER_API_BASE}/txn-stats`, ); + setTimeout(() => this.updateTxnStats(), 22000); } updateBlocks() {