diff options
author | Josh Blum | 2013-03-31 22:31:13 -0700 |
---|---|---|
committer | Josh Blum | 2013-03-31 22:31:13 -0700 |
commit | a6cfe0fc89473d6f39d3376147f1de1658b47c46 (patch) | |
tree | bdf6bbf333607c27456a0e6bb989283e0cad6234 /python/gras/query/main.js | |
parent | 9b96f5791d3cf743ff69be1665f6096bee683e32 (diff) | |
parent | bd00a7db0d10287b2b5d65bb9401b47108b35c10 (diff) | |
download | sandhi-a6cfe0fc89473d6f39d3376147f1de1658b47c46.tar.gz sandhi-a6cfe0fc89473d6f39d3376147f1de1658b47c46.tar.bz2 sandhi-a6cfe0fc89473d6f39d3376147f1de1658b47c46.zip |
Merge branch 'query_work'
Diffstat (limited to 'python/gras/query/main.js')
-rw-r--r-- | python/gras/query/main.js | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/python/gras/query/main.js b/python/gras/query/main.js index a9c255b..b17af63 100644 --- a/python/gras/query/main.js +++ b/python/gras/query/main.js @@ -3,7 +3,7 @@ **********************************************************************/ var GrasStatsRegistry = function() { - this.overall_rate = 2.0; + this.overall_rate = 3.0; this.overall_active = true; this.block_ids = new Array(); this.top_id = 'top'; @@ -38,21 +38,19 @@ var gras_query_stats = function(registry) { registry.online = true; gras_handle_offline(registry); - if (registry.overall_active) - { - gras_chart_factory_update(registry, response); + if (registry.overall_active) gras_chart_factory_update(registry, response); - registry.timeout_handle = window.setTimeout(function() - { - gras_query_stats(registry); - }, Math.round(1000/registry.overall_rate)); - } + var timeout = registry.overall_active? Math.round(1000/registry.overall_rate) : 1000; + window.setTimeout(function() + { + gras_query_stats(registry); + }, timeout); }, error: function() { registry.online = false; gras_handle_offline(registry); - registry.timeout_handle = window.setTimeout(function() + window.setTimeout(function() { gras_query_stats(registry); }, 1000); @@ -77,5 +75,5 @@ var gras_stats_main = function() }); //initialize the charts factory - gras_chart_factory_init(registry, gras_query_stats); + gras_chart_factory_init(registry); } |