mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-11-25 00:05:29 +00:00
c97b8e6851
* EchoEvent now supports `extra` params for job delay and deduplication * When Echo identifies this type of param it creates a DelayedEchoNotificationJob that will be executed after `delay` seconds Change-Id: Ib0c6789dfe42e9703a67835909e5932c0054089f
18 lines
486 B
PHP
18 lines
486 B
PHP
<?php
|
|
|
|
class EchoNotificationJob extends Job {
|
|
|
|
public function __construct( Title $title, array $params ) {
|
|
$command = isset( $params['jobReleaseTimestamp'] ) ? 'DelayedEchoNotificationJob' : 'EchoNotificationJob';
|
|
parent::__construct( $command, $title, $params );
|
|
}
|
|
|
|
public function run() {
|
|
$eventMapper = new EchoEventMapper();
|
|
$event = $eventMapper->fetchById( $this->params['eventId'], true );
|
|
EchoNotificationController::notify( $event, false );
|
|
|
|
return true;
|
|
}
|
|
}
|