Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F2750897
WatchlistExpiryJob.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
931 B
Referenced Files
None
Subscribers
None
WatchlistExpiryJob.php
View Options
<?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
Details
Attached
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)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment