diff --git a/README.md b/README.md index 5932f96866c..f0bffa99ba0 100644 --- a/README.md +++ b/README.md @@ -68,8 +68,8 @@ In a nutshell: ## Requirements -- PHP 7.4+ (PHP 8.0 is supported, PHP 8.1 supported but some warnings may be shown/logged, PHP 8.2 is usable but still being tested) -- MySQL 5.6+ (8.0+ recommended) or MariaDB +- PHP 7.4 to 8.2 +- MySQL 5.7+ (8.0+ recommended) or MariaDB - optional: Redis 5.x, 6.x and 7.0.x are supported diff --git a/app/code/core/Mage/Core/Model/Config.php b/app/code/core/Mage/Core/Model/Config.php index 0e0e7f556e0..b1233b1c4d5 100644 --- a/app/code/core/Mage/Core/Model/Config.php +++ b/app/code/core/Mage/Core/Model/Config.php @@ -502,10 +502,10 @@ public function getCache() */ public function getCacheSaveLock($waitTime = null, $ignoreFailure = false) { - if (! Mage::app()->useCache('config')) { + if (!Mage::app()->useCache('config')) { return; } - $waitTime = $waitTime ?: (PHP_SAPI === 'cli' ? 60 : 3); + $waitTime = $waitTime ?: (getenv('MAGE_CONFIG_CACHE_LOCK_WAIT') ?: (PHP_SAPI === 'cli' ? 60 : 3)); $connection = Mage::getSingleton('core/resource')->getConnection('core_write'); if (!$connection->fetchOne("SELECT GET_LOCK('core_config_cache_save_lock', ?)", [$waitTime])) { if ($ignoreFailure) { @@ -513,7 +513,8 @@ public function getCacheSaveLock($waitTime = null, $ignoreFailure = false) } elseif (PHP_SAPI === 'cli') { throw new Exception('Could not get lock on cache save operation.'); } else { - require_once Mage::getBaseDir() . DS . 'errors' . DS . '503.php'; + Mage::log(sprintf('Failed to get cache save lock in %d seconds.', $waitTime), Zend_Log::NOTICE); + require Mage::getBaseDir() . DS . 'errors' . DS . '503.php'; die(); } } @@ -526,7 +527,7 @@ public function getCacheSaveLock($waitTime = null, $ignoreFailure = false) */ public function releaseCacheSaveLock() { - if (! Mage::app()->useCache('config')) { + if (!Mage::app()->useCache('config')) { return; } $connection = Mage::getSingleton('core/resource')->getConnection('core_write');