From: Aaron Schulz Date: Mon, 29 Aug 2016 16:11:02 +0000 (-0700) Subject: Fix shutdown() code duplication in LBFactory X-Git-Tag: 1.31.0-rc.0~5853^2 X-Git-Url: http://git.cyclocoop.org/%24self?a=commitdiff_plain;h=9de1e0ebe2c1f0d695f5f90d3c6ae247bdbeca13;p=lhc%2Fweb%2Fwiklou.git Fix shutdown() code duplication in LBFactory Merge duplicate shutdown() methods from LBFactory subclasses to the base class, as cronProt is also set there too. Change-Id: I4050b3469f61b1f4173d5841ff2497f3f30e1382 --- diff --git a/includes/db/loadbalancer/LBFactory.php b/includes/db/loadbalancer/LBFactory.php index f560cf17ab..84f7fcb3d2 100644 --- a/includes/db/loadbalancer/LBFactory.php +++ b/includes/db/loadbalancer/LBFactory.php @@ -196,9 +196,12 @@ abstract class LBFactory implements DestructibleService { /** * Prepare all tracked load balancers for shutdown * @param integer $flags Supports SHUTDOWN_* flags - * STUB */ public function shutdown( $flags = 0 ) { + if ( !( $flags & self::SHUTDOWN_NO_CHRONPROT ) ) { + $this->shutdownChronologyProtector( $this->chronProt ); + } + $this->commitMasterChanges( __METHOD__ ); // sanity } /** diff --git a/includes/db/loadbalancer/LBFactoryMulti.php b/includes/db/loadbalancer/LBFactoryMulti.php index 4b9cccc86a..f201081389 100644 --- a/includes/db/loadbalancer/LBFactoryMulti.php +++ b/includes/db/loadbalancer/LBFactoryMulti.php @@ -418,11 +418,4 @@ class LBFactoryMulti extends LBFactory { call_user_func_array( $callback, array_merge( [ $lb ], $params ) ); } } - - public function shutdown( $flags = 0 ) { - if ( !( $flags & self::SHUTDOWN_NO_CHRONPROT ) ) { - $this->shutdownChronologyProtector( $this->chronProt ); - } - $this->commitMasterChanges( __METHOD__ ); // sanity - } } diff --git a/includes/db/loadbalancer/LBFactorySimple.php b/includes/db/loadbalancer/LBFactorySimple.php index 3702c8b05d..c7c4752c6b 100644 --- a/includes/db/loadbalancer/LBFactorySimple.php +++ b/includes/db/loadbalancer/LBFactorySimple.php @@ -159,11 +159,4 @@ class LBFactorySimple extends LBFactory { call_user_func_array( $callback, array_merge( [ $lb ], $params ) ); } } - - public function shutdown( $flags = 0 ) { - if ( !( $flags & self::SHUTDOWN_NO_CHRONPROT ) ) { - $this->shutdownChronologyProtector( $this->chronProt ); - } - $this->commitMasterChanges( __METHOD__ ); // sanity - } }