allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject [2/2] allura git commit: Speed up checking of newly forked repo (patterned after tarball, merge request pages)
Date Thu, 30 Jun 2016 21:46:19 GMT
Speed up checking of newly forked repo (patterned after tarball, merge request pages)


Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/91a0f562
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/91a0f562
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/91a0f562

Branch: refs/heads/db/8078
Commit: 91a0f56289e23798918845a4da26af23d0efdb43
Parents: 9b0b332
Author: Dave Brondsema <dave@brondsema.net>
Authored: Thu Jun 30 17:46:08 2016 -0400
Committer: Dave Brondsema <dave@brondsema.net>
Committed: Thu Jun 30 17:46:08 2016 -0400

----------------------------------------------------------------------
 Allura/allura/templates/repo/repo_master.html | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/91a0f562/Allura/allura/templates/repo/repo_master.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/repo/repo_master.html b/Allura/allura/templates/repo/repo_master.html
index 8de6236..1d94285 100644
--- a/Allura/allura/templates/repo/repo_master.html
+++ b/Allura/allura/templates/repo/repo_master.html
@@ -50,20 +50,23 @@
   // The repo_status div will only be present if repo.status != 'ready'
   if (repo_status) {
     $('.spinner').show()
+    var delay = 500;
     function check_status() {
         $.get('{{repo.url()}}status', function(data) {
             if (data.status === 'ready') {
-                window.clearInterval(status_checker);
                 $('.spinner').hide()
                 $('#repo_status h2').html('Repo status: ready. <a href=".">Click here
to refresh this page.</a>');
             }
             else {
                 $('#repo_status h2 span').html(data.status);
+                if (delay < 60000){
+                    delay = delay * 2;
+                }
+                window.setTimeout(check_status, delay);
             }
         });
     }
-    // Check repo status every 15 seconds
-    var status_checker = window.setInterval(check_status, 15000);
+    var status_checker = window.setTimeout(check_status, delay);
     {% endif %}
   }
 }());


Mime
View raw message