Skip to content

Commit

Permalink
Merge pull request #92 from netgen/cache-bugfix
Browse files Browse the repository at this point in the history
Explictly save cache item when renewing it
  • Loading branch information
RandyCupic authored Jun 30, 2022
2 parents f339a1f + 535b838 commit 366ed71
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ public function listFolders()
$cacheItem->set($list);
$cacheItem->expiresAfter($this->ttl);
$cacheItem->tag($this->getCacheTags(self::FOLDER_LIST));
$this->cache->save($cacheItem);

return $list;
}
Expand All @@ -229,6 +230,7 @@ public function listSubFolders(string $parentFolder)
$cacheItem->set($list);
$cacheItem->expiresAfter($this->ttl);
$cacheItem->tag($this->getCacheTags(self::FOLDER_LIST));
$this->cache->save($cacheItem);

return $list;
}
Expand Down Expand Up @@ -273,6 +275,7 @@ public function countResourcesInFolder($folder)
$cacheItem->set($count);
$cacheItem->expiresAfter($this->ttl);
$cacheItem->tag($this->getCacheTags(self::FOLDER_COUNT));
$this->cache->save($cacheItem);

return $count;
}
Expand Down Expand Up @@ -300,6 +303,7 @@ public function get($id, $type)
$cacheItem->set($value);
$cacheItem->expiresAfter($this->ttl);
$cacheItem->tag($this->getItemCacheTags($id));
$this->cache->save($cacheItem);

return $value;
}
Expand All @@ -324,6 +328,7 @@ public function listTags()
$cacheItem->set($list);
$cacheItem->expiresAfter($this->ttl);
$cacheItem->tag($this->getCacheTags(self::TAG_LIST));
$this->cache->save($cacheItem);

return $list;
}
Expand Down

0 comments on commit 366ed71

Please sign in to comment.