48 parent::__construct(
'activityUpdateJob',
$params );
50 static $required = [
'type',
'userid',
'notifTime',
'curTime' ];
51 $missing = implode(
', ', array_diff( $required, array_keys( $this->params ) ) );
52 if ( $missing !=
'' ) {
53 throw new InvalidArgumentException(
"Missing parameter(s) $missing" );
56 $this->removeDuplicates =
true;
59 public function run() {
60 if ( $this->params[
'type'] ===
'updateWatchlistNotification' ) {
63 throw new InvalidArgumentException(
"Invalid 'type' '{$this->params['type']}'." );
70 $casTimestamp = $this->params[
'notifTime'] ?? $this->params[
'curTime'];
79 $casTimeCond =
'wl_notificationtimestamp < ' . $dbw->addQuotes( $dbw->timestamp( $casTimestamp ) );
82 $wlId = $dbw->selectField(
86 'wl_user' => $this->params[
'userid'],
87 'wl_namespace' => $this->title->getNamespace(),
88 'wl_title' => $this->title->getDBkey(),
100 [
'wl_notificationtimestamp' => $dbw->timestampOrNull( $this->params[
'notifTime'] ) ],
102 'wl_id' => (
int)$wlId,
wfGetDB( $db, $groups=[], $wiki=false)
Get a Database object.
Job for updating user activity like "last viewed" timestamps.
updateWatchlistNotification()
__construct( $title, array $params)
Class to both describe a background job and handle jobs.
array $params
Array of job parameters.