summaryrefslogtreecommitdiff
path: root/maintenance/gearman/gearmanWorker.php
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2012-05-03 13:01:35 +0200
committerPierre Schmitz <pierre@archlinux.de>2012-05-03 13:01:35 +0200
commitd9022f63880ce039446fba8364f68e656b7bf4cb (patch)
tree16b40fbf17bf7c9ee6f4ead25b16dd192378050a /maintenance/gearman/gearmanWorker.php
parent27cf83d177256813e2e802241085fce5dd0f3fb9 (diff)
Update to MediaWiki 1.19.0
Diffstat (limited to 'maintenance/gearman/gearmanWorker.php')
-rw-r--r--maintenance/gearman/gearmanWorker.php43
1 files changed, 0 insertions, 43 deletions
diff --git a/maintenance/gearman/gearmanWorker.php b/maintenance/gearman/gearmanWorker.php
deleted file mode 100644
index 3ea10081..00000000
--- a/maintenance/gearman/gearmanWorker.php
+++ /dev/null
@@ -1,43 +0,0 @@
-<?php
-
-$optionsWithArgs = array( 'fake-job', 'procs' );
-require( dirname( __FILE__ ) . '/../commandLine.inc' );
-require( dirname( __FILE__ ) . '/gearman.inc' );
-
-ini_set( 'memory_limit', '150M' );
-
-if ( isset( $options['procs'] ) ) {
- $procs = $options['procs'];
- if ( $procs < 1 || $procs > 1000 ) {
- echo "Invalid number of processes, please specify a number between 1 and 1000\n";
- exit( 1 );
- }
- $fc = new ForkController( $procs, ForkController::RESTART_ON_ERROR );
- if ( $fc->start() != 'child' ) {
- exit( 0 );
- }
-}
-
-if ( !$args ) {
- $args = array( 'localhost' );
-}
-
-if ( isset( $options['fake-job'] ) ) {
- $params = unserialize( $options['fake-job'] );
- MWGearmanJob::runNoSwitch( $params );
-}
-
-$worker = new NonScaryGearmanWorker( $args );
-$worker->addAbility( 'mw_job' );
-$worker->beginWork( 'wfGearmanMonitor' );
-
-function wfGearmanMonitor( $idle, $lastJob ) {
- static $lastSleep = 0;
- $interval = 5;
- $now = time();
- if ( $now - $lastSleep >= $interval ) {
- wfWaitForSlaves();
- $lastSleep = $now;
- }
- return false;
-}