Give up after 10 tries

This commit is contained in:
Eric Rasche
2014-10-18 18:38:04 -04:00
parent 0cae9aad0c
commit a76cf1da28
@@ -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('<img id="spinner" src="' + galaxy_root + '/static/style/largespinner.gif" style="position:absolute;margin:auto;top:0;left:0;right:0;bottom:0;">');
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");
}
});