* @return bool
*/
protected function doIsEmpty() {
- $dbr = $this->getSlaveDB();
+ $dbr = $this->getReplicaDB();
try {
$found = $dbr->selectField( // unclaimed job
'job', '1', [ 'job_cmd' => $this->type, 'job_token' => '' ], __METHOD__
}
try {
- $dbr = $this->getSlaveDB();
+ $dbr = $this->getReplicaDB();
$size = (int)$dbr->selectField( 'job', 'COUNT(*)',
[ 'job_cmd' => $this->type, 'job_token' => '' ],
__METHOD__
return $count;
}
- $dbr = $this->getSlaveDB();
+ $dbr = $this->getReplicaDB();
try {
$count = (int)$dbr->selectField( 'job', 'COUNT(*)',
[ 'job_cmd' => $this->type, "job_token != {$dbr->addQuotes( '' )}" ],
return $count;
}
- $dbr = $this->getSlaveDB();
+ $dbr = $this->getReplicaDB();
try {
$count = (int)$dbr->selectField( 'job', 'COUNT(*)',
[
* @return Iterator
*/
protected function getJobIterator( array $conds ) {
- $dbr = $this->getSlaveDB();
+ $dbr = $this->getReplicaDB();
try {
return new MappedIterator(
$dbr->select( 'job', self::selectFields(), $conds ),
}
protected function doGetSiblingQueuesWithJobs( array $types ) {
- $dbr = $this->getSlaveDB();
+ $dbr = $this->getReplicaDB();
// @note: this does not check whether the jobs are claimed or not.
// This is useful so JobQueueGroup::pop() also sees queues that only
// have stale jobs. This lets recycleAndDeleteStaleJobs() re-enqueue
}
protected function doGetSiblingQueueSizes( array $types ) {
- $dbr = $this->getSlaveDB();
+ $dbr = $this->getReplicaDB();
$res = $dbr->select( 'job', [ 'job_cmd', 'COUNT(*) AS count' ],
[ 'job_cmd' => $types ], __METHOD__, [ 'GROUP BY' => 'job_cmd' ] );
* @throws JobQueueConnectionError
* @return DBConnRef
*/
- protected function getSlaveDB() {
+ protected function getReplicaDB() {
try {
return $this->getDB( DB_REPLICA );
} catch ( DBConnectionError $e ) {