# HG changeset patch # User Marcin Kuzminski # Date 2016-06-02 14:28:40 # Node ID 110fb2a4422bd07b8f87ed0bd63b91e9c1bca467 # Parent 6d3db5bee761a66765a4f1c3a359d242f6d8c8b7 repo: when creating repos if we don't get JSON results, stop execution at refresh. diff --git a/rhodecode/templates/admin/repos/repo_creating.html b/rhodecode/templates/admin/repos/repo_creating.html --- a/rhodecode/templates/admin/repos/repo_creating.html +++ b/rhodecode/templates/admin/repos/repo_creating.html @@ -50,19 +50,19 @@ if (resp.status == 200) { var jsonResponse = resp.responseJSON; - if (jsonResponse === undefined){ - setTimeout(function(){ + if (jsonResponse === undefined) { + setTimeout(function () { // we might have a backend problem, try dashboard again window.location = "${h.url('summary_home', repo_name = c.repo)}"; - }, 1000); - } - - if (skipCheck || jsonResponse.result === true) { - // success, means go to dashboard - window.location = "${h.url('summary_home', repo_name = c.repo)}"; + }, 3000); } else { - // Schedule the next request when the current one's complete - setTimeout(worker, 1000); + if (skipCheck || jsonResponse.result === true) { + // success, means go to dashboard + window.location = "${h.url('summary_home', repo_name = c.repo)}"; + } else { + // Schedule the next request when the current one's complete + setTimeout(worker, 1000); + } } } else {