Skip to content
Snippets Groups Projects
Commit c3f5904b authored by JediKev's avatar JediKev Committed by Peter Rotich
Browse files

upgrader: Flush Cache On Upgrade

This addresses an issue where the Upgrader will sometimes use an outdated
cached object and throw an error. This adds a the function to clear the
Model Cache every time the Upgrader runs an Upgrade Patch to get fresh
objects.
parent d3beb9e8
Branches
Tags
No related merge requests found
...@@ -362,6 +362,10 @@ class StreamUpgrader extends SetupWizard { ...@@ -362,6 +362,10 @@ class StreamUpgrader extends SetupWizard {
if(!($max_time = ini_get('max_execution_time'))) if(!($max_time = ini_get('max_execution_time')))
$max_time = 300; //Apache/IIS defaults. $max_time = 300; //Apache/IIS defaults.
// Drop any model meta cache to ensure model changes do not cause
// crashes
ModelMeta::flushModelCache();
// Apply up to five patches at a time // Apply up to five patches at a time
foreach (array_slice($patches, 0, 5) as $patch) { foreach (array_slice($patches, 0, 5) as $patch) {
//TODO: check time used vs. max execution - break if need be //TODO: check time used vs. max execution - break if need be
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment