X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fobjectcache%2FSqlBagOStuff.php;h=4a3445e935536a2f2f022cc2c59d1368b4cd5a89;hb=ecc3a4663acd271d43af5a816ba8da7ba89c4d10;hp=d713396b570bf45557bc9f52d7f36cd2dcad4e87;hpb=7a08b3a13eb61e7a6c65b5f7ea9a09e2f12dc8b3;p=lhc%2Fweb%2Fwiklou.git 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 ) );