From: Umherirrender Date: Sun, 30 Sep 2018 14:01:23 +0000 (+0200) Subject: Fix caller name in ApiStashEdit::parseAndStash X-Git-Tag: 1.34.0-rc.0~3953 X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=commitdiff_plain;h=7b05197301ee330865d2d377cc1005b6c61cb251 Fix caller name in ApiStashEdit::parseAndStash Seeing {closure} in the logs as caller is not helpful Change-Id: Id77253bdd4b65b0673214e7bf6ca3cc26bd155fa --- diff --git a/includes/api/ApiStashEdit.php b/includes/api/ApiStashEdit.php index ab9ae8e4e1..17c8040c38 100644 --- a/includes/api/ApiStashEdit.php +++ b/includes/api/ApiStashEdit.php @@ -174,6 +174,7 @@ class ApiStashEdit extends ApiBase { $title = $page->getTitle(); $key = self::getStashKey( $title, self::getContentHash( $content ), $user ); + $fname = __METHOD__; // Use the master DB to allow for fast blocking locks on the "save path" where this // value might actually be used to complete a page edit. If the edit submission request @@ -182,13 +183,13 @@ class ApiStashEdit extends ApiBase { // need to duplicate parsing of the same content/user/summary bundle, so try to avoid // blocking at all here. $dbw = wfGetDB( DB_MASTER ); - if ( !$dbw->lock( $key, __METHOD__, 0 ) ) { + if ( !$dbw->lock( $key, $fname, 0 ) ) { // De-duplicate requests on the same key return self::ERROR_BUSY; } /** @noinspection PhpUnusedLocalVariableInspection */ - $unlocker = new ScopedCallback( function () use ( $dbw, $key ) { - $dbw->unlock( $key, __METHOD__ ); + $unlocker = new ScopedCallback( function () use ( $dbw, $key, $fname ) { + $dbw->unlock( $key, $fname ); } ); $cutoffTime = time() - self::PRESUME_FRESH_TTL_SEC;