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:
Ed Sanders 2024-02-21 15:55:17 +00:00
parent 1bd3a78966
commit b4e4f30234

View file

@ -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' )