diff --git a/cache/stores/mongodb/lib.php b/cache/stores/mongodb/lib.php index 5bd2e84ac16..baf684a3cce 100644 --- a/cache/stores/mongodb/lib.php +++ b/cache/stores/mongodb/lib.php @@ -556,6 +556,9 @@ class cachestore_mongodb extends cache_store implements cache_is_configurable { } $store = new cachestore_mongodb('Test mongodb', $configuration); + if (!$store->is_ready()) { + return false; + } $store->initialise($definition); return $store;