Skip to content

Commit

Permalink
Database isolation_level for Drupal 10
Browse files Browse the repository at this point in the history
  • Loading branch information
back-2-95 committed Dec 5, 2022
1 parent 702238b commit b64d7c3
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/Reader.php
Original file line number Diff line number Diff line change
Expand Up @@ -281,5 +281,13 @@ private function setDatabaseConnection()
'port' => getenv('DRUPAL_DB_PORT') ?: 3306,
'prefix' => getenv('DRUPAL_DB_PREFIX') ?: '',
];

$drupal_10 = version_compare($this->drupal_version, '10.0.0-alpha1', '>=');

if ($drupal_10) {
$this->databases['default']['default']['init_commands'] = [
'isolation_level' => 'SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED',
];
}
}
}

0 comments on commit b64d7c3

Please sign in to comment.