Without this apirunjobs can't handle delayed jobs.
Small inline comment updates as well.
Change-Id: I85ba0ac99eaebc16eaa7e2eb7019546241f3149c
$query['signature'] = ApiRunJobs::getQuerySignature( $query );
if ( !$wgEnableAPI ) {
- ApiRunJobs::executeJobs( $n ); // slow fallback
+ // Fall back to running the job here while the user waits
+ ApiRunJobs::executeJobs( $n );
return;
}
wfRestoreWarnings();
if ( !$sock ) {
wfDebugLog( 'runJobs', "Failed to start cron API (socket error $errno): $errstr\n" );
- ApiRunJobs::executeJobs( $n ); // slow fallback
+ // Fall back to running the job here while the user waits
+ ApiRunJobs::executeJobs( $n );
return;
}
return;
}
try {
- // Fallback to running the jobs here while the user waits
$group = JobQueueGroup::singleton();
+ $count = $group->executeReadyPeriodicTasks();
+ if ( $count > 0 ) {
+ wfDebugLog( 'jobqueue', "Executed $count periodic queue task(s)." );
+ }
+
do {
- $job = $group->pop( JobQueueGroup::USE_CACHE ); // job from any queue
+ $job = $group->pop( JobQueueGroup::TYPE_DEFAULT, JobQueueGroup::USE_CACHE ); // job from any queue
if ( $job ) {
$output = $job->toString() . "\n";
$t = - microtime( true );