11 $cache = \MediaWiki\MediaWikiServices::getInstance()->getMainWANObjectCache();
15 $jobq->get(
'htmlCacheUpdate' )->delete();
16 $jobq->get(
'recentChangesUpdate' )->delete();
17 $jobq->get(
'userGroupExpiry' )->delete();
18 $cache->delete(
$cache->makeKey(
'SiteStats',
'jobscount' ) );
20 $jobq->push(
new NullJob( Title::newMainPage(), [] ) );
22 'A single job enqueued bumps jobscount stat to 1' );
24 $jobq->push(
new NullJob( Title::newMainPage(), [] ) );
26 'SiteStats::jobs() count does not reflect addition ' .
27 'of a second job (cached)'
30 $jobq->get(
'null' )->delete();
31 $this->assertEquals( 0, $jobq->get(
'null' )->getSize(),
32 'Job queue for NullJob has been cleaned' );
34 $cache->delete(
$cache->makeKey(
'SiteStats',
'jobscount' ) );
36 'jobs count is kept in process cache' );
38 $cache->clearProcessCache();
Simple store for keeping values in an associative array for the current process.
static singleton( $domain=false)
Degenerate job that does nothing, but can optionally replace itself in the queue and/or sleep for a b...
testJobsCountGetCached()
SiteStats::jobs.
static jobs()
Total number of jobs in the job queue.
Multi-datacenter aware caching interface.