mediawiki-extensions-Echo/includes/jobs/NotificationJob.php
Petr Pchelko bf2cc7e687 Remove masterPos from the job specification.
The `DBMasterPos` class is not JSON-serializable, so
we can not transfer the job in the kafka-based queue.
Before, we were waiting for slaves before executing the
job till the point in time when the job was submitted,
now we will just wait for slaves till the point in time
the job was executed. That lets up not to include the
database master position in the event and make it serializable.

Bug: T192945
Change-Id: I7c754bd1e899bad030cc6434be19daf2542e015f
2018-06-18 19:56:15 +03:00

19 lines
417 B
PHP

<?php
class EchoNotificationJob extends Job {
private $eventId;
function __construct( $title, $params ) {
parent::__construct( 'EchoNotificationJob', $title, $params );
$this->eventId = $params['eventId'];
}
function run() {
MWEchoDbFactory::newFromDefault()->waitForSlaves();
$event = EchoEvent::newFromID( $this->eventId );
EchoNotificationController::notify( $event, false );
return true;
}
}