Page MenuHomeWickedGov Phorge

WatchlistExpiryJob.php
No OneTemporary

Size
931 B
Referenced Files
None
Subscribers
None

WatchlistExpiryJob.php

<?php
namespace MediaWiki\Watchlist;
use Job;
use MediaWiki\MediaWikiServices;
/**
* @internal For use by WatchedItemStore
* @ingroup JobQueue
*/
class WatchlistExpiryJob extends Job {
public function __construct( string $command = 'watchlistExpiry', array $params = [] ) {
parent::__construct( $command, $params );
}
/**
* Run the job recursively in batches of 100 until there are no more expired items.
*
* @return bool Always true, to indicate success.
*/
public function run() {
$services = MediaWikiServices::getInstance();
$watchedItemStore = $services->getWatchedItemStore();
$watchedItemStore->removeExpired( 100 );
if ( $watchedItemStore->countExpired() ) {
// If there are still items, add a new job.
$services->getJobQueueGroup()->push( new static() );
}
return true;
}
}
/** @deprecated class alias since 1.43 */
class_alias( WatchlistExpiryJob::class, 'WatchlistExpiryJob' );

File Metadata

Mime Type
text/x-php
Expires
Fri, Jul 3, 17:22 (21 h, 28 m)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
d4/9a/06c56c1cd1294548ee601609f94b
Default Alt Text
WatchlistExpiryJob.php (931 B)

Event Timeline