* @return void
*/
public function push( $jobs ) {
+ global $wgJobTypesExcludedFromDefaultQueue;
+
$jobs = is_array( $jobs ) ? $jobs : [ $jobs ];
if ( !count( $jobs ) ) {
return;
$this->cache->clear( 'queues-ready' );
}
}
+
+ $cache = ObjectCache::getLocalClusterInstance();
+ $cache->set(
+ $cache->makeGlobalKey( 'jobqueue', $this->wiki, 'hasjobs', self::TYPE_ANY ),
+ 'true',
+ 15
+ );
+ if ( array_diff( array_keys( $jobsByType ), $wgJobTypesExcludedFromDefaultQueue ) ) {
+ $cache->set(
+ $cache->makeGlobalKey( 'jobqueue', $this->wiki, 'hasjobs', self::TYPE_DEFAULT ),
+ 'true',
+ 15
+ );
+ }
}
/**
}
/**
- * Wait for any slaves or backup queue servers to catch up.
+ * Wait for any replica DBs or backup queue servers to catch up.
*
* This does nothing for certain queue classes.
*
* @since 1.23
*/
public function queuesHaveJobs( $type = self::TYPE_ANY ) {
- $key = wfMemcKey( 'jobqueue', 'queueshavejobs', $type );
$cache = ObjectCache::getLocalClusterInstance();
+ $key = $cache->makeGlobalKey( 'jobqueue', $this->wiki, 'hasjobs', $type );
$value = $cache->get( $key );
if ( $value === false ) {