From b44222de224ddd53f78fc9e33b6df4e2cde71569 Mon Sep 17 00:00:00 2001 From: Marcin Kuzminski Date: Thu, 2 Jun 2016 16:28:40 +0200 Subject: [PATCH] repo: when creating repos if we don't get JSON results, stop execution at refresh. --- .../templates/admin/repos/repo_creating.html | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/rhodecode/templates/admin/repos/repo_creating.html b/rhodecode/templates/admin/repos/repo_creating.html index 5dd7d8c5..a1967c91 100644 --- 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 {