From 851e9918f3bda56111c42f7fcf867958bdecc9b2 Mon Sep 17 00:00:00 2001 From: Petr Balashov Date: Mon, 27 Mar 2017 11:30:41 +0200 Subject: [PATCH] added 2 min ajax timeout on app start --- gui/init.js | 4 ++-- gui/loading.js | 1 + routes/cache.js | 9 ++++++++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/gui/init.js b/gui/init.js index a55a4d3..24ceda0 100644 --- a/gui/init.js +++ b/gui/init.js @@ -11,9 +11,9 @@ $(document).ready(function() { $('#loading_status_text').text('Starting Iguana daemon...'); - //if (appConf && !appConf.manualIguanaStart) { + if (appConf && !appConf.manualIguanaStart) { StartIguana(); - //} + } var portcheck; diff --git a/gui/loading.js b/gui/loading.js index fe5146c..cf1927f 100644 --- a/gui/loading.js +++ b/gui/loading.js @@ -4,6 +4,7 @@ function IguanaAJAX(url, ajax_data) { url: url, type: 'POST', dataType: 'json', + timeout: 120000 //beforeSend: showLoadingImgFn }) .fail(function(xhr, textStatus, error) { diff --git a/routes/cache.js b/routes/cache.js index c1b7b41..c3f1314 100644 --- a/routes/cache.js +++ b/routes/cache.js @@ -561,7 +561,14 @@ cache.one = function(req, res, next) { getAddresses(coin); } } else { - callStack[coin] = callStack[coin] + (coin === 'BTC' ? callsArray.length : callsArray.length - 2); + var callsArrayBTC = callsArray.length; // restrict BTC and SYS only to listunspent and listtransactions calls + if (callsArray.indexOf('getbalance') > - 1) { + callsArrayBTC--; + } + if (callsArray.indexOf('refresh') > - 1) { + callsArrayBTC--; + } + callStack[coin] = callStack[coin] + (coin === 'BTC' || coin === 'SYS' ? callsArrayBTC : callsArray.length); console.log(coin + ' stack len ' + callStack[coin]); execDEXRequests(coin, address);