Commit c99f461d authored by catch's avatar catch
Browse files

Issue #1848968 by Berdir: Fixed Too many checksum tag queries executed by the cache backend.

parent 9318aa16
......@@ -272,6 +272,7 @@ protected function checksumTags($tags) {
$query_tags[] = $tag;
}
}
if ($query_tags) {
try {
if ($db_tags = Database::getConnection()->query('SELECT tag, invalidations FROM {cache_tags} WHERE tag IN (:tags)', array(':tags' => $query_tags))->fetchAllKeyed()) {
......
......@@ -69,7 +69,7 @@ public function read($name) {
// Read from the storage on a cache miss and cache the data, if any.
$data = $this->storage->read($name);
if ($data !== FALSE) {
$this->cache->set($name, $data, CacheBackendInterface::CACHE_PERMANENT, array('config' => array($name)));
$this->cache->set($name, $data, CacheBackendInterface::CACHE_PERMANENT);
}
// If the cache contained bogus data and there is no data in the storage,
// wipe the cache entry.
......@@ -86,7 +86,7 @@ public function write($name, array $data) {
if ($this->storage->write($name, $data)) {
// While not all written data is read back, setting the cache instead of
// just deleting it avoids cache rebuild stampedes.
$this->cache->set($name, $data, CacheBackendInterface::CACHE_PERMANENT, array('config' => array($name)));
$this->cache->set($name, $data, CacheBackendInterface::CACHE_PERMANENT);
return TRUE;
}
return FALSE;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment