Make LocalFile file locking calls use Status::wrap
authorAaron Schulz <aschulz@wikimedia.org>
Wed, 13 Jun 2018 23:52:31 +0000 (16:52 -0700)
committerAddshore <addshorewiki@gmail.com>
Thu, 14 Jun 2018 07:30:07 +0000 (07:30 +0000)
This avoids the assumption that a wrapper was set in the FileBackend.

Change-Id: I4d41d63b00e41476d885f714d17d1ba62b63b6ec

includes/filerepo/file/LocalFile.php

index adad9ad..e86f292 100644 (file)
@@ -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
-               );
+               ) );
        }
 
        /**