allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject [1/2] allura git commit: Speed up checking of newly forked repo (patterned after tarball, merge request pages)
Date Tue, 05 Jul 2016 19:36:15 GMT
Repository: allura
Updated Branches:
  refs/heads/master 81cfcf9aa -> 11886e8cf


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/11886e8c
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/11886e8c
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/11886e8c

Branch: refs/heads/master
Commit: 11886e8cf5f5ad503b636e2a9842d551008146b1
Parents: 019ef2f
Author: Dave Brondsema <dave@brondsema.net>
Authored: Thu Jun 30 17:46:08 2016 -0400
Committer: Dave Brondsema <dave@brondsema.net>
Committed: Tue Jul 5 15:36:02 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/11886e8c/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