Thread (51 messages) flat view 51 messages, 2 authors, 2016-06-15
STALE3733d

[PATCH 06/18] gitweb: Add more explicit means of disabling 'Generating...' page

From: "John 'Warthog9' Hawley" <warthog9@eaglescrag.net>
Date: 2016-06-15 22:50:13
Subsystem: the rest · Maintainer: Linus Torvalds

As requested this adds $cacheGenStatus variable, default 1 (on).
If caching is enabled it will explicitly disble the display of the
'Generating...' page and just force the user to stall indefinately.

Also adding it to gitweb's test code as I'm sure the 'Generating...'
page isn't that useful there.

Signed-off-by: John 'Warthog9' Hawley <warthog9@eaglescrag.net>
---
 gitweb/gitweb.perl  |    6 ++++++
 gitweb/lib/cache.pl |    2 ++
 t/gitweb-lib.sh     |    1 +
 3 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index f2ef3da..05e7ba6 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -293,6 +293,12 @@ our $maxCacheLife = 18000;
 # Used to enable or disable background forking of the gitweb caching.  Mainly here for debugging purposes
 our $cacheDoFork = 1;
 
+# Used to enable or disable the foreground "Generating..." page.  This is here to be more explicit should
+# people want to disable it.
+# Default: 1 (True - Enabled)
+# To disable set to 0
+our $cacheGenStatus = 1;
+
 our $fullhashpath = *STDOUT;
 our $fullhashbinpath = *STDOUT;
 our $fullhashbinpathfinal = *STDOUT;
diff --git a/gitweb/lib/cache.pl b/gitweb/lib/cache.pl
index dd14bfb..a8ee99e 100644
--- a/gitweb/lib/cache.pl
+++ b/gitweb/lib/cache.pl
@@ -224,6 +224,8 @@ sub cacheWaitForUpdate {
 		$action eq "rss"
 		||
 		$action eq "opml"
+		||
+		! $cacheGenStatus
 	){
 		do {
 			sleep 2 if $x > 0;
diff --git a/t/gitweb-lib.sh b/t/gitweb-lib.sh
index 16ce811..10c4a3d 100755
--- a/t/gitweb-lib.sh
+++ b/t/gitweb-lib.sh
@@ -26,6 +26,7 @@ our \$projects_list = '';
 our \$export_ok = '';
 our \$strict_export = '';
 our \$maxload = undef;
+our \$cacheGenStatus = 0;
 
 EOF
 
-- 
1.7.2.3
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help