mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2025-11-01 02:46:04 +01:00
Remove caching from Pages count (regular)
This commit is contained in:
@@ -910,17 +910,8 @@ class Admin
|
|||||||
public function pagesCount()
|
public function pagesCount()
|
||||||
{
|
{
|
||||||
if (!$this->pages_count) {
|
if (!$this->pages_count) {
|
||||||
/** @var Cache $cache */
|
$pages = static::enablePages();
|
||||||
$cache = $this->grav['cache'];
|
$this->pages_count = count($pages->all());
|
||||||
$count = $cache->fetch('admin-pages-count');
|
|
||||||
if (false === $count) {
|
|
||||||
$pages = static::enablePages();
|
|
||||||
|
|
||||||
$count = count($pages->all());
|
|
||||||
$cache->save('admin-pages-count', $count);
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->pages_count = $count;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->pages_count;
|
return $this->pages_count;
|
||||||
|
|||||||
Reference in New Issue
Block a user