}
wfProfileIn( __METHOD__ );
$ok = $this->doBatchPush( $jobs, $flags );
- if ( $ok ) {
- wfIncrStats( 'job-insert', count( $jobs ) );
- }
wfProfileOut( __METHOD__ );
return $ok;
}
final public function pop() {
wfProfileIn( __METHOD__ );
$job = $this->doPop();
- if ( $job ) {
- wfIncrStats( 'job-pop' );
- }
wfProfileOut( __METHOD__ );
return $job;
}
foreach ( array_chunk( $rows, 50 ) as $rowBatch ) {
$dbw->insert( 'job', $rowBatch, __METHOD__ );
}
+ wfIncrStats( 'job-insert', count( $rows ) );
} catch ( DBError $e ) {
if ( $atomic ) {
$dbw->rollback( __METHOD__ );
$wgMemc->set( $this->getEmptinessCacheKey(), 'true', self::CACHE_TTL );
break; // nothing to do
}
+ wfIncrStats( 'job-pop' );
// Get the job object from the row...
$title = Title::makeTitleSafe( $row->job_namespace, $row->job_title );
if ( !$title ) {
$dbw->delete( 'job', array( 'job_id' => $row->job_id ), __METHOD__ );
- wfIncrStats( 'job-pop' );
wfDebugLog( 'JobQueueDB', "Row has invalid title '{$row->job_title}'." );
continue; // try again
}