Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

MDL-37645 cache: fixed issue deleting mongo instance

  • Loading branch information...
commit bb4c3916888bff112b8fad6666b7eb7b8975e813 1 parent 8fd56c1
@samhemelryk samhemelryk authored
View
4 cache/stores/memcache/lib.php
@@ -339,7 +339,7 @@ public function instance_deleted() {
$connection->addServer($server[0], $server[1], true, $server[2]);
}
}
- $connection->flush();
+ @$connection->flush();
unset($connection);
unset($this->connection);
}
@@ -376,4 +376,4 @@ public static function initialise_test_instance(cache_definition $definition) {
public function my_name() {
return $this->name;
}
-}
+}
View
4 cache/stores/memcached/lib.php
@@ -424,7 +424,7 @@ public function instance_deleted() {
$connection->addServers($this->servers);
}
}
- $connection->flush();
+ @$connection->flush();
unset($connection);
unset($this->connection);
}
@@ -477,4 +477,4 @@ public static function initialise_test_instance(cache_definition $definition) {
public function my_name() {
return $this->name;
}
-}
+}
View
8 cache/stores/mongodb/lib.php
@@ -463,7 +463,13 @@ public function instance_deleted() {
if ($this->connection) {
$connection = $this->connection;
} else {
- $connection = new Mongo($this->server, $this->options);
+ try {
+ $connection = new Mongo($this->server, $this->options);
+ } catch (MongoConnectionException $e) {
+ // We only want to catch MongoConnectionExceptions here.
+ // If the server cannot be connected to we cannot clean it.
+ return;
+ }
}
$database = $connection->selectDB($this->databasename);
$database->drop();
Please sign in to comment.
Something went wrong with that request. Please try again.