protected $wiki; // string; wiki ID
const TYPE_DEFAULT = 1; // integer; jobs popped by default
- const TYPE_ANY = 2; // integer; any job
+ const TYPE_ANY = 2; // integer; any job
const USE_CACHE = 1; // integer; use process or persistent cache
const CACHE_VERSION = 1; // integer; cache version
/**
- * @param $wiki string Wiki ID
+ * @param string $wiki Wiki ID
*/
protected function __construct( $wiki ) {
$this->wiki = $wiki;
}
/**
- * @param $wiki string Wiki ID
+ * @param string $wiki Wiki ID
* @return JobQueueGroup
*/
public static function singleton( $wiki = false ) {
return $this->get( $job->getType() )->deduplicateRootJob( $job );
}
+ /**
+ * Wait for any slaves or backup queue servers to catch up.
+ *
+ * This does nothing for certain queue classes.
+ *
+ * @return void
+ * @throws MWException
+ */
+ public function waitForBackups() {
+ global $wgJobTypeConf;
+
+ wfProfileIn( __METHOD__ );
+ // Try to avoid doing this more than once per queue storage medium
+ foreach ( $wgJobTypeConf as $type => $conf ) {
+ $this->get( $type )->waitForBackups();
+ }
+ wfProfileOut( __METHOD__ );
+ }
+
/**
* Get the list of queue types
*