MediaWiki  REL1_23
RunJobs Class Reference

Maintenance script that runs pending jobs. More...

Inheritance diagram for RunJobs:
Collaboration diagram for RunJobs:

List of all members.

Public Member Functions

 __construct ()
 execute ()
 memoryLimit ()
 Normally we disable the memory_limit when running admin scripts.

Private Member Functions

 assertMemoryOK ()
 Make sure that this script is not too close to the memory usage limit.
 getBackoffTimeToWait (Job $job)
 loadBackoffs ()
 Get the previous backoff expiries from persistent storage.
 runJobsLog ($msg)
 Log the job message.
 syncBackoffs (array $backoffs)
 Merge the current backoff expiries from persistent storage.

Detailed Description

Maintenance script that runs pending jobs.

Definition at line 31 of file runJobs.php.


Constructor & Destructor Documentation

Reimplemented from Maintenance.

Definition at line 32 of file runJobs.php.

References Maintenance\addOption().


Member Function Documentation

RunJobs::assertMemoryOK ( ) [private]

Make sure that this script is not too close to the memory usage limit.

It is better to die in between jobs than OOM right in the middle of one.

Exceptions:
MWException

Definition at line 244 of file runJobs.php.

References array(), and list.

Referenced by execute().

RunJobs::getBackoffTimeToWait ( Job job) [private]
Parameters:
Job$job
Returns:
integer Seconds for this runner to avoid doing more jobs of this type
See also:
$wgJobBackoffThrottling

Definition at line 173 of file runJobs.php.

References Job\getType(), global, and Job\workItemCount().

Referenced by execute().

RunJobs::loadBackoffs ( ) [private]

Get the previous backoff expiries from persistent storage.

Returns:
array Map of (job type => backoff expiry timestamp)

Definition at line 199 of file runJobs.php.

References $file, $section, array(), and wfTempDir().

Referenced by execute().

Normally we disable the memory_limit when running admin scripts.

Some scripts may wish to actually set a limit, however, to avoid blowing up unexpectedly. We also support a --memory-limit option, to allow sysadmins to explicitly set one if they'd prefer to override defaults (or for people using Suhosin which yells at you for trying to disable the limits)

Returns:
string

Reimplemented from Maintenance.

Definition at line 42 of file runJobs.php.

References Maintenance\hasOption().

RunJobs::runJobsLog ( msg) [private]

Log the job message.

Parameters:
$msgString The message to log

Definition at line 266 of file runJobs.php.

References Maintenance\output(), wfDebugLog(), and wfTimestamp().

Referenced by execute().

RunJobs::syncBackoffs ( array backoffs) [private]

Merge the current backoff expiries from persistent storage.

Parameters:
array$backoffsMap of (job type => backoff expiry timestamp)

Definition at line 221 of file runJobs.php.

References $file, $section, $timestamp, array(), as, and wfTempDir().

Referenced by execute().


The documentation for this class was generated from the following file: