if ( $page->getTouched() >= $this->params['rootJobTimestamp'] || $opportunistic ) {
// Cache is suspected to be up-to-date. As long as the cache rev ID matches
// and it reflects the job's triggering change, then it is usable.
- $parserOutput = ParserCache::singleton()->getDirty( $page, $parserOptions );
+ $parserOutput = $services->getParserCache()->getDirty( $page, $parserOptions );
if ( !$parserOutput
|| $parserOutput->getCacheRevisionId() != $revision->getId()
|| $parserOutput->getCacheTime() < $skewedTimestamp
&& $parserOutput->isCacheable()
) {
$ctime = wfTimestamp( TS_MW, (int)$start ); // cache time
- ParserCache::singleton()->save(
+ $services->getParserCache()->save(
$parserOutput, $page, $parserOptions, $ctime, $revision->getId()
);
}
}
public function workItemCount() {
- return isset( $this->params['pages'] ) ? count( $this->params['pages'] ) : 1;
+ if ( !empty( $this->params['recursive'] ) ) {
+ return 0; // nothing actually refreshed
+ } elseif ( isset( $this->params['pages'] ) ) {
+ return count( $this->params['pages'] );
+ }
+
+ return 1; // one title
}
}