Index: branches/wmf/1.17wmf1/maintenance/jobs-loop.sh |
— | — | @@ -6,28 +6,32 @@ |
7 | 7 | type=$1 |
8 | 8 | } |
9 | 9 | |
| 10 | +types="htmlCacheUpdate sendMail enotifNotify uploadFromUrl fixDoubleRedirect" |
| 11 | + |
10 | 12 | cd `readlink -f /usr/local/apache/common/php/maintenance` |
11 | 13 | while [ 1 ];do |
| 14 | + # Do the prioritised types |
| 15 | + for type in $types; do |
| 16 | + db=`php -n nextJobDB.php --type="$type"` |
| 17 | + if [ -n "$db" ]; then |
| 18 | + echo "$db $type" |
| 19 | + nice -n 20 php runJobs.php --wiki="$db" --procs=4 "$type" |
| 20 | + fi |
| 21 | + done |
| 22 | + |
| 23 | + # Do the remaining types |
12 | 24 | db= |
13 | 25 | while [ -z $db ];do |
14 | | - if [ ! -z "$type" ]; then |
15 | | - db=`php -n nextJobDB.php --type=$type` |
16 | | - else |
17 | | - db=`php -n nextJobDB.php` |
18 | | - fi |
| 26 | + db=`php -n nextJobDB.php` |
19 | 27 | |
20 | 28 | if [ -z $db ];then |
21 | 29 | # No jobs to do, wait for a while |
22 | 30 | echo "No jobs..." |
23 | 31 | sleep 5 |
| 32 | + else |
| 33 | + echo $db |
| 34 | + nice -n 20 php runJobs.php --wiki="$db" --procs=4 |
24 | 35 | fi |
25 | 36 | done |
26 | | - echo $db |
27 | | - if [ ! -z "$type" ]; then |
28 | | - nice -n 20 php runJobs.php $db --procs=4 $type & |
29 | | - else |
30 | | - nice -n 20 php runJobs.php $db --procs=4 & |
31 | | - fi |
32 | | - wait |
33 | 37 | done |
34 | 38 | |