From: Aaron Schulz Date: Wed, 18 Sep 2019 02:22:51 +0000 (-0700) Subject: objectcache: fix DatabaseSqlite::initSqliteDatabase() call location X-Git-Tag: 1.34.0-rc.0~169^2 X-Git-Url: http://git.cyclocoop.org/data/%7B%24admin_url%7Dconfig?a=commitdiff_plain;h=990e9268e3f59ebebce2b933654672e591844e13;p=lhc%2Fweb%2Fwiklou.git objectcache: fix DatabaseSqlite::initSqliteDatabase() call location This should be called in the non-LB cause (e.g. custom DBs). Follow-up mishandled merge conflict in 3298a9db9021. Bug: T233117 Change-Id: I71a5c28db05a3c294e5c244037be2ee0209d61ad --- diff --git a/includes/objectcache/SqlBagOStuff.php b/includes/objectcache/SqlBagOStuff.php index d713396b57..4a3445e935 100644 --- a/includes/objectcache/SqlBagOStuff.php +++ b/includes/objectcache/SqlBagOStuff.php @@ -194,6 +194,10 @@ class SqlBagOStuff extends MediumSpecificBagOStuff { $conn = Database::factory( $type, $info ); $conn->clearFlag( DBO_TRX ); // auto-commit mode $this->conns[$shardIndex] = $conn; + // Automatically create the objectcache table for sqlite as needed + if ( $conn->getType() === 'sqlite' ) { + $this->initSqliteDatabase( $conn ); + } } $conn = $this->conns[$shardIndex]; } else { @@ -206,10 +210,6 @@ class SqlBagOStuff extends MediumSpecificBagOStuff { $attribs = $lb->getServerAttributes( $lb->getWriterIndex() ); $flags = $attribs[Database::ATTR_DB_LEVEL_LOCKING] ? 0 : $lb::CONN_TRX_AUTOCOMMIT; $conn = $lb->getMaintenanceConnectionRef( $index, [], false, $flags ); - // Automatically create the objectcache table for sqlite as needed - if ( $conn->getType() === 'sqlite' ) { - $this->initSqliteDatabase( $conn ); - } } $this->logger->debug( sprintf( "Connection %s will be used for SqlBagOStuff", $conn ) );