From: Aaron Schulz Date: Sat, 29 Oct 2016 07:04:39 +0000 (-0700) Subject: Rename JobQueueDB::getSlaveDB() to getReplicaDB() X-Git-Tag: 1.31.0-rc.0~4990^2 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/comptes/ajouter.php?a=commitdiff_plain;h=1eb86e0e4d85a06b5930dfb80260f5bbfac3632d;p=lhc%2Fweb%2Fwiklou.git Rename JobQueueDB::getSlaveDB() to getReplicaDB() Change-Id: I7a88c4876e76836c92cc0b45b4e72124a087121c --- diff --git a/includes/jobqueue/JobQueueDB.php b/includes/jobqueue/JobQueueDB.php index aa017688d4..84b2a0b2dd 100644 --- a/includes/jobqueue/JobQueueDB.php +++ b/includes/jobqueue/JobQueueDB.php @@ -69,7 +69,7 @@ class JobQueueDB extends JobQueue { * @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__ @@ -94,7 +94,7 @@ class JobQueueDB extends JobQueue { } try { - $dbr = $this->getSlaveDB(); + $dbr = $this->getReplicaDB(); $size = (int)$dbr->selectField( 'job', 'COUNT(*)', [ 'job_cmd' => $this->type, 'job_token' => '' ], __METHOD__ @@ -123,7 +123,7 @@ class JobQueueDB extends JobQueue { return $count; } - $dbr = $this->getSlaveDB(); + $dbr = $this->getReplicaDB(); try { $count = (int)$dbr->selectField( 'job', 'COUNT(*)', [ 'job_cmd' => $this->type, "job_token != {$dbr->addQuotes( '' )}" ], @@ -154,7 +154,7 @@ class JobQueueDB extends JobQueue { return $count; } - $dbr = $this->getSlaveDB(); + $dbr = $this->getReplicaDB(); try { $count = (int)$dbr->selectField( 'job', 'COUNT(*)', [ @@ -566,7 +566,7 @@ class JobQueueDB extends JobQueue { * @return Iterator */ protected function getJobIterator( array $conds ) { - $dbr = $this->getSlaveDB(); + $dbr = $this->getReplicaDB(); try { return new MappedIterator( $dbr->select( 'job', self::selectFields(), $conds ), @@ -594,7 +594,7 @@ class JobQueueDB extends JobQueue { } 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 @@ -611,7 +611,7 @@ class JobQueueDB extends JobQueue { } 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' ] ); @@ -737,7 +737,7 @@ class JobQueueDB extends JobQueue { * @throws JobQueueConnectionError * @return DBConnRef */ - protected function getSlaveDB() { + protected function getReplicaDB() { try { return $this->getDB( DB_REPLICA ); } catch ( DBConnectionError $e ) {