dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
mediawiki.util: Add mw.log.deprecate to #jsMessage
[lhc/web/wiklou.git]
/
maintenance
/
runJobs.php
diff --git
a/maintenance/runJobs.php
b/maintenance/runJobs.php
index
dc9c763
..
b488fe9
100644
(file)
--- a/
maintenance/runJobs.php
+++ b/
maintenance/runJobs.php
@@
-43,6
+43,7
@@
class RunJobs extends Maintenance {
if ( $this->hasOption( 'memory-limit' ) ) {
return parent::memoryLimit();
}
if ( $this->hasOption( 'memory-limit' ) ) {
return parent::memoryLimit();
}
+
// Don't eat all memory on the machine if we get a bad job.
return "150M";
}
// Don't eat all memory on the machine if we get a bad job.
return "150M";
}
@@
-79,7
+80,9
@@
class RunJobs extends Maintenance {
$backoffs = $this->loadBackoffs(); // map of (type => UNIX expiry)
$startingBackoffs = $backoffs; // avoid unnecessary writes
$backoffs = $this->loadBackoffs(); // map of (type => UNIX expiry)
$startingBackoffs = $backoffs; // avoid unnecessary writes
- $backoffExpireFunc = function( $t ) { return $t > time(); };
+ $backoffExpireFunc = function ( $t ) {
+ return $t > time();
+ };
$jobsRun = 0; // counter
$flags = JobQueueGroup::USE_CACHE;
$jobsRun = 0; // counter
$flags = JobQueueGroup::USE_CACHE;
@@
-99,7
+102,7
@@
class RunJobs extends Maintenance {
$this->runJobsLog( $job->toString() . " STARTING" );
// Set timer to stop the job if too much CPU time is used
$this->runJobsLog( $job->toString() . " STARTING" );
// Set timer to stop the job if too much CPU time is used
- set_time_limit( $maxTime ?: 0 );
+ set_time_limit( $maxTime ?
: 0 );
// Run the job...
wfProfileIn( __METHOD__ . '-' . get_class( $job ) );
$t = microtime( true );
// Run the job...
wfProfileIn( __METHOD__ . '-' . get_class( $job ) );
$t = microtime( true );
@@
-167,7
+170,7
@@
class RunJobs extends Maintenance {
/**
* @param Job $job
/**
* @param Job $job
- * @return int
eger
Seconds for this runner to avoid doing more jobs of this type
+ * @return int Seconds for this runner to avoid doing more jobs of this type
* @see $wgJobBackoffThrottling
*/
private function getBackoffTimeToWait( Job $job ) {
* @see $wgJobBackoffThrottling
*/
private function getBackoffTimeToWait( Job $job ) {
@@
-207,7
+210,7
@@
class RunJobs extends Maintenance {
$content = stream_get_contents( $handle );
flock( $handle, LOCK_UN );
fclose( $handle );
$content = stream_get_contents( $handle );
flock( $handle, LOCK_UN );
fclose( $handle );
- $backoffs = json_decode( $content, true ) ?: array();
+ $backoffs = json_decode( $content, true ) ?
: array();
}
return $backoffs;
}
return $backoffs;
@@
-225,7
+228,7
@@
class RunJobs extends Maintenance {
$handle = fopen( $file, 'wb+' );
flock( $handle, LOCK_EX );
$content = stream_get_contents( $handle );
$handle = fopen( $file, 'wb+' );
flock( $handle, LOCK_EX );
$content = stream_get_contents( $handle );
- $cBackoffs = json_decode( $content, true ) ?: array();
+ $cBackoffs = json_decode( $content, true ) ?
: array();
foreach ( $backoffs as $type => $timestamp ) {
$cBackoffs[$type] = isset( $cBackoffs[$type] ) ? $cBackoffs[$type] : 0;
$cBackoffs[$type] = max( $cBackoffs[$type], $backoffs[$type] );
foreach ( $backoffs as $type => $timestamp ) {
$cBackoffs[$type] = isset( $cBackoffs[$type] ) ? $cBackoffs[$type] : 0;
$cBackoffs[$type] = max( $cBackoffs[$type], $backoffs[$type] );
@@
-261,7
+264,7
@@
class RunJobs extends Maintenance {
/**
* Log the job message
/**
* Log the job message
- * @param
$msg Strin
g The message to log
+ * @param
string $ms
g The message to log
*/
private function runJobsLog( $msg ) {
$this->output( wfTimestamp( TS_DB ) . " $msg\n" );
*/
private function runJobsLog( $msg ) {
$this->output( wfTimestamp( TS_DB ) . " $msg\n" );