dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "Fix changes list misaligned arrow"
[lhc/web/wiklou.git]
/
includes
/
jobqueue
/
jobs
/
RefreshLinksJob.php
diff --git
a/includes/jobqueue/jobs/RefreshLinksJob.php
b/includes/jobqueue/jobs/RefreshLinksJob.php
index
b4ead5d
..
51e964d
100644
(file)
--- a/
includes/jobqueue/jobs/RefreshLinksJob.php
+++ b/
includes/jobqueue/jobs/RefreshLinksJob.php
@@
-207,7
+207,7
@@
class RefreshLinksJob extends Job {
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.
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
if ( !$parserOutput
|| $parserOutput->getCacheRevisionId() != $revision->getId()
|| $parserOutput->getCacheTime() < $skewedTimestamp
@@
-234,7
+234,7
@@
class RefreshLinksJob extends Job {
&& $parserOutput->isCacheable()
) {
$ctime = wfTimestamp( TS_MW, (int)$start ); // cache time
&& $parserOutput->isCacheable()
) {
$ctime = wfTimestamp( TS_MW, (int)$start ); // cache time
-
ParserCache::singleton
()->save(
+
$services->getParserCache
()->save(
$parserOutput, $page, $parserOptions, $ctime, $revision->getId()
);
}
$parserOutput, $page, $parserOptions, $ctime, $revision->getId()
);
}
@@
-291,7
+291,7
@@
class RefreshLinksJob extends Job {
if ( is_array( $info['params'] ) ) {
// For per-pages jobs, the job title is that of the template that changed
// (or similar), so remove that since it ruins duplicate detection
if ( is_array( $info['params'] ) ) {
// For per-pages jobs, the job title is that of the template that changed
// (or similar), so remove that since it ruins duplicate detection
- if ( isset( $info['pages'] ) ) {
+ if ( isset( $info['pa
rams']['pa
ges'] ) ) {
unset( $info['namespace'] );
unset( $info['title'] );
}
unset( $info['namespace'] );
unset( $info['title'] );
}
@@
-301,6
+301,12
@@
class RefreshLinksJob extends Job {
}
public function workItemCount() {
}
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
}
}
}
}