mirror of
https://github.com/moodle/moodle.git
synced 2025-01-17 21:49:15 +01:00
MDL-56748 cache: Removes cache definition instances in purge_store
Previously a purge_store was only purging caches but it was leaving a reference to the store instance for the cache definition. As a result, the cache was never cleared away correctly and, in cases where the cache store makes a TCP connection to a backend system, the number of open sockets was increasing for each store instance. After a complete purge, as found in the unit test reset, the cache definitions should be both purged and removed. This change should also lead to a drop in memory consumption for unit tests as there will no longer be references to unused definition stores.
This commit is contained in:
parent
da31fc5bff
commit
70aa00de87
1
cache/classes/factory.php
vendored
1
cache/classes/factory.php
vendored
@ -161,6 +161,7 @@ class cache_factory {
|
||||
$factory->reset_cache_instances();
|
||||
$factory->configs = array();
|
||||
$factory->definitions = array();
|
||||
$factory->definitionstores = array();
|
||||
$factory->lockplugins = array(); // MUST be null in order to force its regeneration.
|
||||
// Reset the state to uninitialised.
|
||||
$factory->state = self::STATE_UNINITIALISED;
|
||||
|
Loading…
x
Reference in New Issue
Block a user