From: Aaron Schulz Date: Tue, 6 Oct 2015 18:10:33 +0000 (-0700) Subject: Remove begin/commit from recordOldUpload() X-Git-Tag: 1.31.0-rc.0~9513^2 X-Git-Url: https://git.heureux-cyclage.org/?a=commitdiff_plain;h=735455fd8f4c41c3ff8e85c2911261d95e28fe58;p=lhc%2Fweb%2Fwiklou.git Remove begin/commit from recordOldUpload() * The only caller already has has transaction via lock/unlock and does the file operations first (avoiding contention) * Also made recordOldUpload() protected Change-Id: Ib03ca76895a181ed513a289e2b44f6b97e4a1bc0 --- diff --git a/includes/filerepo/file/OldLocalFile.php b/includes/filerepo/file/OldLocalFile.php index fd92e11a06..42ee9e46a7 100644 --- a/includes/filerepo/file/OldLocalFile.php +++ b/includes/filerepo/file/OldLocalFile.php @@ -364,9 +364,8 @@ class OldLocalFile extends LocalFile { * @param User $user User who did this upload * @return bool */ - function recordOldUpload( $srcPath, $archiveName, $timestamp, $comment, $user ) { + protected function recordOldUpload( $srcPath, $archiveName, $timestamp, $comment, $user ) { $dbw = $this->repo->getMasterDB(); - $dbw->begin( __METHOD__ ); $dstPath = $this->repo->getZonePath( 'public' ) . '/' . $this->getRel(); $props = $this->repo->getFileProps( $dstPath ); @@ -394,8 +393,6 @@ class OldLocalFile extends LocalFile { ), __METHOD__ ); - $dbw->commit( __METHOD__ ); - return true; }