Skip to content
Snippets Groups Projects
Unverified Commit 57c65c3e authored by Joas Schilling's avatar Joas Schilling
Browse files

Make sure old instances don't break

parent bf043deb
No related branches found
No related tags found
No related merge requests found
...@@ -83,7 +83,7 @@ class Factory implements ICacheFactory { ...@@ -83,7 +83,7 @@ class Factory implements ICacheFactory {
$missingCacheMessage = 'Memcache {class} not available for {use} cache'; $missingCacheMessage = 'Memcache {class} not available for {use} cache';
$missingCacheHint = 'Is the matching PHP module installed and enabled?'; $missingCacheHint = 'Is the matching PHP module installed and enabled?';
if (!$localCacheClass::isAvailable()) { if (!class_exists($localCacheClass) || !$localCacheClass::isAvailable()) {
if (\OC::$CLI && !defined('PHPUNIT_RUN')) { if (\OC::$CLI && !defined('PHPUNIT_RUN')) {
// CLI should not hard-fail on broken memcache // CLI should not hard-fail on broken memcache
$this->logger->info($missingCacheMessage, [ $this->logger->info($missingCacheMessage, [
...@@ -98,7 +98,7 @@ class Factory implements ICacheFactory { ...@@ -98,7 +98,7 @@ class Factory implements ICacheFactory {
]), $missingCacheHint); ]), $missingCacheHint);
} }
} }
if (!$distributedCacheClass::isAvailable()) { if (!class_exists($distributedCacheClass) || !$distributedCacheClass::isAvailable()) {
if (\OC::$CLI && !defined('PHPUNIT_RUN')) { if (\OC::$CLI && !defined('PHPUNIT_RUN')) {
// CLI should not hard-fail on broken memcache // CLI should not hard-fail on broken memcache
$this->logger->info($missingCacheMessage, [ $this->logger->info($missingCacheMessage, [
...@@ -113,7 +113,7 @@ class Factory implements ICacheFactory { ...@@ -113,7 +113,7 @@ class Factory implements ICacheFactory {
]), $missingCacheHint); ]), $missingCacheHint);
} }
} }
if (!($lockingCacheClass && $lockingCacheClass::isAvailable())) { if (!($lockingCacheClass && class_exists($distributedCacheClass) && $lockingCacheClass::isAvailable())) {
// don't fallback since the fallback might not be suitable for storing lock // don't fallback since the fallback might not be suitable for storing lock
$lockingCacheClass = self::NULL_CACHE; $lockingCacheClass = self::NULL_CACHE;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment