Skip to content

Set STATE_INITIALISING before loading config #68 #69

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 15, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion classes/cache_factory.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ public function create_config_instance($writer = false) {

if (!array_key_exists($class, $this->configs)) {
// Create a new instance and call it to load it.
// As part of generating store instance config we test the initialisation of stores.
// Testing this may initialise DI, which will attempt to use cache for hookcallbacks.
// Setting the state to initialising will make it use ad-hoc cache for that request.
self::set_state(self::STATE_INITIALISING);
$this->configs[$class] = new $class;
$this->configs[$class]->load();
}
Expand All @@ -67,7 +71,7 @@ public function create_config_instance($writer = false) {
$this->set_state(self::STATE_STORES_DISABLED);
} else {
// We cannot directly set the state to enabled from disabled.
// So we instead start and finish an update.
// So we instead start and finish an update to set STATE_READY.
$this->updating_started();
$this->updating_finished();
}
Expand Down
Loading