PrefetchCache: Purge any object cache on forget or initialize
This commit is contained in:
parent
ef41022a73
commit
6d3702a893
|
@ -3,6 +3,7 @@
|
||||||
namespace Icinga\Module\Director\Db\Cache;
|
namespace Icinga\Module\Director\Db\Cache;
|
||||||
|
|
||||||
use Icinga\Module\Director\CustomVariable\CustomVariable;
|
use Icinga\Module\Director\CustomVariable\CustomVariable;
|
||||||
|
use Icinga\Module\Director\Data\Db\DbObject;
|
||||||
use Icinga\Module\Director\Db;
|
use Icinga\Module\Director\Db;
|
||||||
use Icinga\Module\Director\Objects\IcingaObject;
|
use Icinga\Module\Director\Objects\IcingaObject;
|
||||||
use Icinga\Module\Director\Resolver\HostServiceBlacklist;
|
use Icinga\Module\Director\Resolver\HostServiceBlacklist;
|
||||||
|
@ -36,6 +37,7 @@ class PrefetchCache
|
||||||
|
|
||||||
public static function initialize(Db $db)
|
public static function initialize(Db $db)
|
||||||
{
|
{
|
||||||
|
self::forget();
|
||||||
self::$instance = new static($db);
|
self::$instance = new static($db);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -60,6 +62,7 @@ class PrefetchCache
|
||||||
|
|
||||||
public static function forget()
|
public static function forget()
|
||||||
{
|
{
|
||||||
|
DbObject::clearAllPrefetchCaches();
|
||||||
self::$instance = null;
|
self::$instance = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue