Cleaned up $asyncWrites member variable in MultiWriteBagOStuff
authorAaron Schulz <aschulz@wikimedia.org>
Mon, 21 Sep 2015 18:41:44 +0000 (11:41 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Mon, 21 Sep 2015 18:41:44 +0000 (11:41 -0700)
Change-Id: I27e48aef77ac0f6453b7837f2b2686b7b5b726d4

includes/objectcache/MultiWriteBagOStuff.php

index b390659..16e842f 100644 (file)
@@ -32,9 +32,7 @@ class MultiWriteBagOStuff extends BagOStuff {
        /** @var BagOStuff[] */
        protected $caches;
        /** @var bool Use async secondary writes */
-       protected $asyncReplication = false;
-       /** @var array[] */
-       protected $asyncWrites = array();
+       protected $asyncWrites = false;
 
        /**
         * $params include:
@@ -72,9 +70,7 @@ class MultiWriteBagOStuff extends BagOStuff {
                                : ObjectCache::newFromParams( $cacheInfo );
                }
 
-               if ( isset( $params['replication'] ) && $params['replication'] === 'async' ) {
-                       $this->asyncReplication = true;
-               }
+               $this->asyncWrites = isset( $params['replication'] ) && $params['replication'] === 'async';
        }
 
        /**
@@ -199,7 +195,7 @@ class MultiWriteBagOStuff extends BagOStuff {
                array_shift( $args );
 
                foreach ( $this->caches as $i => $cache ) {
-                       if ( $i == 0 || !$this->asyncReplication ) {
+                       if ( $i == 0 || !$this->asyncWrites ) {
                                // First store or in sync mode: write now and get result
                                if ( !call_user_func_array( array( $cache, $method ), $args ) ) {
                                        $ret = false;