From 735455fd8f4c41c3ff8e85c2911261d95e28fe58 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Tue, 6 Oct 2015 11:10:33 -0700 Subject: [PATCH] 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 --- includes/filerepo/file/OldLocalFile.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) 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; } -- 2.20.1