From a76cf1da286f8d886bb4aba2010cc07d3ddd19ce Mon Sep 17 00:00:00 2001 From: Eric Rasche Date: Sat, 18 Oct 2014 18:38:04 -0400 Subject: [PATCH] Give up after 10 tries --- config/plugins/visualizations/ipython/static/ipython.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/config/plugins/visualizations/ipython/static/ipython.js b/config/plugins/visualizations/ipython/static/ipython.js index 32652129390..1712280e795 100644 --- a/config/plugins/visualizations/ipython/static/ipython.js +++ b/config/plugins/visualizations/ipython/static/ipython.js @@ -65,16 +65,23 @@ function test_ie_availability(url){ */ function load_notebook(password_auth, password, notebook_login_url, notebook_access_url, apache_urls, galaxy_root){ $( document ).ready(function() { + var counter = 0; $('#main').append(''); interval = setInterval(function(){ $.ajax({ type: "GET", url: notebook_access_url, success: function(){ + counter++; clearInterval(interval); _handle_notebook_loading(password_auth, password, notebook_login_url, notebook_access_url, apache_urls); }, - error: function(){ + error: function(a, b, c){ + counter++; + if(counter > 10){ + clearInterval(interval); + console.log("Giving up!"); + } console.log("Some error"); } });