36 parent::__construct(
'activityUpdateJob', $title,
$params );
38 static $required = [
'type',
'userid',
'notifTime',
'curTime' ];
39 $missing = implode(
', ', array_diff( $required, array_keys( $this->params ) ) );
40 if ( $missing !=
'' ) {
41 throw new InvalidArgumentException(
"Missing paramter(s) $missing" );
44 $this->removeDuplicates =
true;
47 public function run() {
48 if ( $this->params[
'type'] ===
'updateWatchlistNotification' ) {
51 throw new InvalidArgumentException(
"Invalid 'type' '{$this->params['type']}'." );
58 $casTimestamp = ( $this->params[
'notifTime'] !== null )
59 ? $this->params[
'notifTime']
60 : $this->params[
'curTime'];
63 $dbw->update(
'watchlist',
65 'wl_notificationtimestamp' => $dbw->timestampOrNull( $this->params[
'notifTime'] )
68 'wl_user' => $this->params[
'userid'],
69 'wl_namespace' => $this->title->getNamespace(),
70 'wl_title' => $this->title->getDBkey(),
77 'wl_notificationtimestamp < ' . $dbw->addQuotes( $dbw->timestamp( $casTimestamp ) )
wfGetDB( $db, $groups=[], $wiki=false)
Get a Database object.
Job for updating user activity like "last viewed" timestamps.
__construct(Title $title, array $params)
updateWatchlistNotification()
Class to both describe a background job and handle jobs.
array $params
Array of job parameters.
Represents a title within MediaWiki.
The wiki should then use memcached to cache various data To use multiple just add more items to the array To increase the weight of a make its entry a array("192.168.0.1:11211", 2))