From 5cd947a18c3e0cb6285fa19159c164b4588369bf Mon Sep 17 00:00:00 2001 From: "James E. Blair" Date: Thu, 8 Mar 2012 16:00:43 -0800 Subject: [PATCH] Repack git repos weekly. Early Sunday mornings, repack all the git repos in gerrit. This currently takes 41 seconds for all 32 repositories, so running it weekly doesn't seem too intensive. Fixes bug 943623. Change-Id: Iff0e999c27b428cd1170706e3dc7ede3a1a178a8 --- modules/gerrit/manifests/init.pp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/modules/gerrit/manifests/init.pp b/modules/gerrit/manifests/init.pp index cee7a6ed16..d42e0b5d1a 100644 --- a/modules/gerrit/manifests/init.pp +++ b/modules/gerrit/manifests/init.pp @@ -61,6 +61,15 @@ $commentlinks = [ { name => 'changeid', command => 'cd /home/gerrit2/openstack-ci && python gerrit/expire_old_reviews.py' } + cron { "gerrit_repack": + user => gerrit2, + weekday => 0, + hour => 4, + minute => 7, + command => 'find /home/gerrit2/review_site/git/ -type d -name "*.git" -print -exec git --git-dir="{}" repack -afd \;', + environment => "PATH=/usr/bin:/bin:/usr/sbin:/sbin", + } + file { "/var/log/gerrit": ensure => "directory", owner => 'gerrit2'