Skip to content

Commit

Permalink
MDL-43033 cache: added stats logging to set_many methods
Browse files Browse the repository at this point in the history
  • Loading branch information
Sam Hemelryk committed Dec 1, 2013
1 parent e28a953 commit 1e9f4c9
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions cache/classes/loaders.php
Expand Up @@ -647,10 +647,11 @@ public function set_many(array $keyvaluearray) {
$this->static_acceleration_set($data[$key]['key'], $value);
}
}
if ($this->perfdebug) {
cache_helper::record_cache_set($this->storetype, $this->definition->get_id());
$successfullyset = $this->store->set_many($data);
if ($this->perfdebug && $successfullyset) {
cache_helper::record_cache_set($this->storetype, $this->definition->get_id(), $successfullyset);
}
return $this->store->set_many($data);
return $successfullyset;
}

/**
Expand Down Expand Up @@ -2037,10 +2038,11 @@ public function set_many(array $keyvaluearray) {
'value' => $value
);
}
if ($this->perfdebug) {
cache_helper::record_cache_set($this->storetype, $definitionid);
$successfullyset = $this->get_store()->set_many($data);
if ($this->perfdebug && $successfullyset) {
cache_helper::record_cache_set($this->storetype, $definitionid, $successfullyset);
}
return $this->get_store()->set_many($data);
return $successfullyset;
}

/**
Expand Down

0 comments on commit 1e9f4c9

Please sign in to comment.