Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
16.67% |
1 / 6 |
|
50.00% |
1 / 2 |
CRAP | |
0.00% |
0 / 1 |
LocalJobSubmitJob | |
16.67% |
1 / 6 |
|
50.00% |
1 / 2 |
8.21 | |
0.00% |
0 / 1 |
__construct | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
run | |
0.00% |
0 / 5 |
|
0.00% |
0 / 1 |
6 |
1 | <?php |
2 | |
3 | namespace Cognate; |
4 | |
5 | use Job; |
6 | use MediaWiki\MediaWikiServices; |
7 | use MediaWiki\Title\Title; |
8 | |
9 | /** |
10 | * @license GPL-2.0-or-later |
11 | * @author Addshore |
12 | */ |
13 | class LocalJobSubmitJob extends Job { |
14 | |
15 | /** @inheritDoc */ |
16 | public function __construct( Title $title, array $params ) { |
17 | parent::__construct( 'CognateLocalJobSubmitJob', $title, $params ); |
18 | } |
19 | |
20 | /** @inheritDoc */ |
21 | public function run() { |
22 | $job = new CacheUpdateJob( $this->getTitle(), [] ); |
23 | |
24 | $jobQueueGroupFactory = MediaWikiServices::getInstance()->getJobQueueGroupFactory(); |
25 | foreach ( $this->params['dbNames'] as $dbName ) { |
26 | $jobQueueGroupFactory->makeJobQueueGroup( $dbName )->push( $job ); |
27 | } |
28 | |
29 | return true; |
30 | } |
31 | |
32 | } |