r110363 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r110362‎ | r110363 | r110364 >
Date:07:50, 31 January 2012
Author:j
Status:ok
Tags:
Comment:
use wfShellMaintenanceCmd to run transcoding job, followup r110104
Modified paths:
  • /trunk/extensions/TimedMediaHandler/maintenance/WebVideoJobRunner.php (modified) (history)

Diff [purge]

Index: trunk/extensions/TimedMediaHandler/maintenance/WebVideoJobRunner.php
@@ -30,6 +30,8 @@
3131 }
3232 if ( $this->hasOption( "wiki" ) ) {
3333 $this->wiki = $this->getOption( 'wiki' ) ;
 34+ } else {
 35+ $this->wiki = false;
3436 }
3537 // Check if WebVideoJobRuner is already running:
3638 $jobRunnerCount = 0;
@@ -68,13 +70,20 @@
6971 }
7072 }
7173 }
72 - if( $runingJobsCount < $this->threads ){
 74+ if( $runingJobsCount < $this->threads ){
7375 // Add one process:
74 - $cmd = "php $IP/maintenance/runJobs.php";
 76+ $parameters = array();
7577 if( $this->wiki ) {
76 - $cmd .= " --wiki " . wfEscapeShellArg ( $this->wiki );
 78+ $parameters[] = '--wiki';
 79+ $parameters[] = $this->wiki;
7780 }
78 - $cmd .= " --type webVideoTranscode --maxjobs 1 --maxtime {$wgTranscodeBackgroundTimeLimit}";
 81+ $parameters[] = '--type';
 82+ $parameters[] = 'webVideoTranscode';
 83+ $parameters[] = '--maxjobs';
 84+ $parameters[] = '1';
 85+ $parameters[] = '--maxtime';
 86+ $parameters[] = $wgTranscodeBackgroundTimeLimit;
 87+ $cmd = wfShellMaintenanceCmd("$IP/maintenance/runJobs.php", $parameters);
7988 $status = $this->runBackgroundProc( $cmd );
8089 $this->output( "$runingJobsCount existing job runners, Check for new transcode jobs: " );
8190 } else {

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r110104- pass wiki option to job threads in maintenance script...j06:25, 27 January 2012

Status & tagging log