mediawiki-extensions-Echo/includes/jobs/NotificationJob.php
Stephane Bisson f361425a34 NotificationJob: make sure we retry to load the event from master
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
2019-04-16 17:06:48 -07:00

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;
}
}