mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-11-16 20:33:29 +00:00
f361425a34
EventMapper->fetchById() has retry on master built-in but it doesn't kick in in a Job because the load balancer is a new instance and doesn't know about previous writes. This change makes the job always read from master to make sure the event is found. It is going to write to master right after anyway. Bug: T204894 Change-Id: I9a2873234f1dd5416e6c2bedeb904880d1f79562
17 lines
378 B
PHP
17 lines
378 B
PHP
<?php
|
|
|
|
class EchoNotificationJob extends Job {
|
|
|
|
public function __construct( $title, $params ) {
|
|
parent::__construct( 'EchoNotificationJob', $title, $params );
|
|
}
|
|
|
|
public function run() {
|
|
$eventMapper = new EchoEventMapper();
|
|
$event = $eventMapper->fetchById( $this->params['eventId'], true );
|
|
EchoNotificationController::notify( $event, false );
|
|
|
|
return true;
|
|
}
|
|
}
|