From 157ba1896bfc17fbd6fedaf3c2d5c4c9f45540ab Mon Sep 17 00:00:00 2001 From: Petr Baudis Date: Wed, 10 Feb 2010 16:19:39 +0100 Subject: [PATCH] jobd: Start first update round at a random point instead of always the beginning --- jobd/jobd.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/jobd/jobd.sh b/jobd/jobd.sh index 709d70c..8b37a37 100755 --- a/jobd/jobd.sh +++ b/jobd/jobd.sh @@ -52,7 +52,8 @@ check_one_proj() check_all_projects() { - get_repo_list | while read proj; do + start_by="$1" + get_repo_list | tail -n +"$start_by" | while read proj; do check_one_proj "$proj" done } @@ -67,6 +68,11 @@ fi case "$1" in "") + # Start the mirroring at a random point; if there is + # some problem in the update process that requires + # frequent restarting of jobd, this tries to give even + # projects late in the list a chance to get an update. + check_all_projects "$((RANDOM%$(get_repo_list | wc -l)))" while true; do check_all_projects sleep 10 -- 2.11.4.GIT