mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/DiscussionTools
synced 2024-11-24 00:13:36 +00:00
ThreadItemStore: Remove "ButTryHarder" from method name
This appears to reference the retry that happens due to REPEATABLE_READ, but that seems like an implementation detail so not really useful to have in in the function name, nor does it disambiguate it from another function. Change-Id: Iacc95b74f25c166545734818efb1b30e18a1754e
This commit is contained in:
parent
1bd3a78966
commit
b4e4f30234
|
@ -482,7 +482,7 @@ class ThreadItemStore {
|
|||
* @param RevisionRecord $rev For error logging
|
||||
* @return int Return value of whichever function succeeded
|
||||
*/
|
||||
private function findOrInsertIdButTryHarder(
|
||||
private function findOrInsertId(
|
||||
callable $find, callable $insert, bool &$didInsert, RevisionRecord $rev
|
||||
) {
|
||||
$dbw = $this->dbProvider->getPrimaryDatabase();
|
||||
|
@ -542,7 +542,7 @@ class ThreadItemStore {
|
|||
// (This is not in a transaction. Orphaned rows in this table are harmlessly ignored,
|
||||
// and long transactions caused performance issues on Wikimedia wikis: T315353#8218914.)
|
||||
foreach ( $threadItemSet->getThreadItems() as $item ) {
|
||||
$itemIdsId = $this->findOrInsertIdButTryHarder(
|
||||
$itemIdsId = $this->findOrInsertId(
|
||||
static function ( IReadableDatabase $dbw ) use ( $item, $method ) {
|
||||
return $dbw->newSelectQueryBuilder()
|
||||
->from( 'discussiontools_item_ids' )
|
||||
|
@ -570,7 +570,7 @@ class ThreadItemStore {
|
|||
// (This is not in a transaction. Orphaned rows in this table are harmlessly ignored,
|
||||
// and long transactions caused performance issues on Wikimedia wikis: T315353#8218914.)
|
||||
foreach ( $threadItemSet->getThreadItems() as $item ) {
|
||||
$itemsId = $this->findOrInsertIdButTryHarder(
|
||||
$itemsId = $this->findOrInsertId(
|
||||
static function ( IReadableDatabase $dbw ) use ( $item, $method ) {
|
||||
return $dbw->newSelectQueryBuilder()
|
||||
->from( 'discussiontools_items' )
|
||||
|
@ -741,7 +741,7 @@ class ThreadItemStore {
|
|||
$itemRevisionsId = $itemRevisionsUpdateId;
|
||||
$didInsert = true;
|
||||
} else {
|
||||
$itemRevisionsId = $this->findOrInsertIdButTryHarder(
|
||||
$itemRevisionsId = $this->findOrInsertId(
|
||||
static function ( IReadableDatabase $dbw ) use ( $itemRevisionsConds, $method ) {
|
||||
return $dbw->newSelectQueryBuilder()
|
||||
->from( 'discussiontools_item_revisions' )
|
||||
|
|
Loading…
Reference in a new issue