Index: branches/wmf/1.17wmf1/maintenance/runJobs.php |
— | — | @@ -31,6 +31,7 @@ |
32 | 32 | parent::__construct(); |
33 | 33 | $this->mDescription = "Run pending jobs"; |
34 | 34 | $this->addOption( 'maxjobs', 'Maximum number of jobs to run', false, true ); |
| 35 | + $this->addOption( 'maxtime', 'Maximum amount of wall-clock time', false, true ); |
35 | 36 | $this->addOption( 'type', 'Type of job to run', false, true ); |
36 | 37 | $this->addOption( 'procs', 'Number of processes to use', false, true ); |
37 | 38 | } |
— | — | @@ -52,7 +53,9 @@ |
53 | 54 | exit( 0 ); |
54 | 55 | } |
55 | 56 | } |
56 | | - $maxJobs = $this->getOption( 'maxjobs', 10000 ); |
| 57 | + $maxJobs = $this->getOption( 'maxjobs', false ); |
| 58 | + $maxTime = $this->getOption( 'maxtime', false ); |
| 59 | + $startTime = time(); |
57 | 60 | $type = $this->getOption( 'type', false ); |
58 | 61 | $wgTitle = Title::newFromText( 'RunJobs.php' ); |
59 | 62 | $dbw = wfGetDB( DB_MASTER ); |
— | — | @@ -80,9 +83,13 @@ |
81 | 84 | } else { |
82 | 85 | $this->runJobsLog( $job->toString() . " t=$timeMs good" ); |
83 | 86 | } |
| 87 | + |
84 | 88 | if ( $maxJobs && ++$n > $maxJobs ) { |
85 | 89 | break 2; |
86 | 90 | } |
| 91 | + if ( $maxTime && time() - $startTime > $maxTime ) { |
| 92 | + break 2; |
| 93 | + } |
87 | 94 | } |
88 | 95 | } |
89 | 96 | } |
Property changes on: branches/wmf/1.17wmf1/maintenance/runJobs.php |
___________________________________________________________________ |
Added: svn:mergeinfo |
90 | 97 | Merged /branches/sqlite/maintenance/runJobs.php:r58211-58321 |
91 | 98 | Merged /trunk/phase3/maintenance/runJobs.php:r79828,79830,79848,79853,79950-79951,79954,79989,80006-80007,80013,80016,80080,80083,80124,80128,80238,81833,83212,83590,83640 |
92 | 99 | Merged /branches/new-installer/phase3/maintenance/runJobs.php:r43664-66004 |
93 | 100 | Merged /branches/wmf-deployment/maintenance/runJobs.php:r60970 |
94 | 101 | Merged /branches/REL1_15/phase3/maintenance/runJobs.php:r51646 |
95 | 102 | Merged /branches/wmf/1.16wmf4/maintenance/runJobs.php:r67177,69199,76243,77266 |
Index: branches/wmf/1.17wmf1/maintenance/jobs-loop.sh |
— | — | @@ -18,7 +18,7 @@ |
19 | 19 | db=`php -n nextJobDB.php --type="$type"` |
20 | 20 | if [ -n "$db" ]; then |
21 | 21 | echo "$db $type" |
22 | | - nice -n 20 php runJobs.php --wiki="$db" --procs=4 --type="$type" & |
| 22 | + nice -n 20 php runJobs.php --wiki="$db" --procs=4 --type="$type" --maxtime=300 & |
23 | 23 | wait |
24 | 24 | moreprio=y |
25 | 25 | fi |
— | — | @@ -34,7 +34,7 @@ |
35 | 35 | sleep 5 |
36 | 36 | else |
37 | 37 | echo "$db" |
38 | | - nice -n 20 php runJobs.php --wiki="$db" --procs=4 & |
| 38 | + nice -n 20 php runJobs.php --wiki="$db" --procs=4 --maxtime=300 & |
39 | 39 | wait |
40 | 40 | fi |
41 | 41 | done |