resourceloader: Avoid opening a connection to master when not needed
SqlModuleDependencyStore::storeMulti() gets called unconditionally by RL::saveModuleDependenciesInternal() and lots of time with empty value, this opens a master connection in GET requests where it's not needed. Let's remove that for now. More info in I462055ce9caa Change-Id: I6f618d396d64c687ba6cc68cfa99bf3f4327e798
This commit is contained in:
parent
575435174b
commit
663e4ce6bb
1 changed files with 6 additions and 0 deletions
|
|
@ -69,6 +69,12 @@ class SqlModuleDependencyStore extends DependencyStore {
|
|||
}
|
||||
|
||||
public function storeMulti( $type, array $dataByEntity, $ttl ) {
|
||||
// Avoid opening a master connection when it's not needed.
|
||||
// ResourceLoader::saveModuleDependenciesInternal calls this method unconditionally
|
||||
// with empty values most of the time.
|
||||
if ( !$dataByEntity ) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
$dbw = $this->getMasterDb();
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue