From 43c6fdc9a4728d7d9007ad97dcb19b6cc9d3acce Mon Sep 17 00:00:00 2001 From: Petr Baudis Date: Wed, 4 Nov 2009 01:33:20 +0100 Subject: [PATCH] jobs/gitwebcache.sh: Introduce for proactive cache regeneration; git.git: Add grpshared support --- git.git | 2 +- gitweb/gitweb_config.perl | 1 + jobs/README | 4 ++++ jobs/gitwebcache.sh | 12 ++++++++++++ 4 files changed, 18 insertions(+), 1 deletion(-) create mode 100755 jobs/gitwebcache.sh diff --git a/git.git b/git.git index 4962ef1..dcd942a 160000 --- a/git.git +++ b/git.git @@ -1 +1 @@ -Subproject commit 4962ef1c7743c2dd3c058ba4469b042663d65537 +Subproject commit dcd942a8a7a136c12c8482e5de33cb5e27272e6a diff --git a/gitweb/gitweb_config.perl b/gitweb/gitweb_config.perl index 6a1f899..651c924 100644 --- a/gitweb/gitweb_config.perl +++ b/gitweb/gitweb_config.perl @@ -59,6 +59,7 @@ our $frontpage_no_project_list = 1; ## if you set this to non-zero, it will be used as the cached ## index lifetime in minutes our $projlist_cache_lifetime = 10; +our $cache_grpshared = 1; $feature{blame}{default}=[1]; diff --git a/jobs/README b/jobs/README index 60aabea..dade466 100644 --- a/jobs/README +++ b/jobs/README @@ -6,6 +6,10 @@ to crontab and usually run the main scripts iteratively per-repository. OR use different permission control than Group. Otherwise, you need to copy fixup* over to ~root and run them from root's crontab. (They are completely self-contained so that you can easily review them.) +* gitwebcache.sh: You should call this from crontab if showing project + list takes too long time when it's not cached; you should call this + in an interval of about a half of the cache lifetime (by default + 10min). * daemons/repod.sh -q --all-once: You should call this to avoid infinitely growing repositories and refresh mirrored projects if you are not running repod all the time. diff --git a/jobs/gitwebcache.sh b/jobs/gitwebcache.sh new file mode 100755 index 0000000..34b1dc5 --- /dev/null +++ b/jobs/gitwebcache.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +. @basedir@/shlib.sh + +set -e + +cd "$cfg_cgiroot" + +# Re-generate the cache; we must be in same group as cgi user and +# $cache_grpshared must be 1. +# We get rid even of stderr since it's just junk from broken repos. +perl -le 'require("./gitweb.cgi"); END { my @list = git_get_projects_list(); cached_project_list_info(\@list, 1, 1, 1); }' >/dev/null 2>&1 -- 2.11.4.GIT