Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 4 |
|
0.00% |
0 / 2 |
CRAP | |
0.00% |
0 / 1 |
| IncomingLinkCount | |
0.00% |
0 / 4 |
|
0.00% |
0 / 2 |
6 | |
0.00% |
0 / 1 |
| __construct | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| doJob | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
2 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace CirrusSearch\Job; |
| 4 | |
| 5 | use CirrusSearch\Updater; |
| 6 | use MediaWiki\Title\Title; |
| 7 | |
| 8 | /** |
| 9 | * Updates link counts to page when it is newly linked or unlinked. |
| 10 | * |
| 11 | * @license GPL-2.0-or-later |
| 12 | */ |
| 13 | class IncomingLinkCount extends CirrusTitleJob { |
| 14 | public function __construct( Title $title, array $params ) { |
| 15 | parent::__construct( $title, $params ); |
| 16 | } |
| 17 | |
| 18 | /** |
| 19 | * @return bool |
| 20 | */ |
| 21 | protected function doJob() { |
| 22 | // Load the titles and filter out any that no longer exist. |
| 23 | $updater = Updater::build( $this->getSearchConfig(), $this->params['cluster'] ?? null ); |
| 24 | // We're intentionally throwing out whether or not this job succeeds. |
| 25 | // We're logging it but we're not retrying. |
| 26 | $updater->updateLinkedArticles( [ $this->getTitle() ] ); |
| 27 | return true; |
| 28 | } |
| 29 | } |