From 505a0e913ac10fd79787b51aa340d2bc28bebdf1 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Wed, 13 Jun 2018 16:52:31 -0700 Subject: [PATCH] Make LocalFile file locking calls use Status::wrap This avoids the assumption that a wrapper was set in the FileBackend. Change-Id: I4d41d63b00e41476d885f714d17d1ba62b63b6ec --- includes/filerepo/file/LocalFile.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/includes/filerepo/file/LocalFile.php b/includes/filerepo/file/LocalFile.php index adad9ad15f..e86f292703 100644 --- a/includes/filerepo/file/LocalFile.php +++ b/includes/filerepo/file/LocalFile.php @@ -2208,7 +2208,7 @@ class LocalFile extends File { // If extra data (metadata) was not loaded then it must have been large return $this->extraDataLoaded - && strlen( serialize( $this->metadata ) ) <= self::CACHE_FIELD_MAX_LEN; + && strlen( serialize( $this->metadata ) ) <= self::CACHE_FIELD_MAX_LEN; } /** @@ -2216,9 +2216,9 @@ class LocalFile extends File { * @since 1.28 */ public function acquireFileLock() { - return $this->getRepo()->getBackend()->lockFiles( + return Status::wrap( $this->getRepo()->getBackend()->lockFiles( [ $this->getPath() ], LockManager::LOCK_EX, 10 - ); + ) ); } /** @@ -2226,9 +2226,9 @@ class LocalFile extends File { * @since 1.28 */ public function releaseFileLock() { - return $this->getRepo()->getBackend()->unlockFiles( + return Status::wrap( $this->getRepo()->getBackend()->unlockFiles( [ $this->getPath() ], LockManager::LOCK_EX - ); + ) ); } /** -- 2.20.1