MDL-37645 cache: fixed issue deleting mongo instance
This commit is contained in:
Vendored
+2
-2
@@ -339,7 +339,7 @@ class cachestore_memcache extends cache_store implements cache_is_configurable {
|
||||
$connection->addServer($server[0], $server[1], true, $server[2]);
|
||||
}
|
||||
}
|
||||
$connection->flush();
|
||||
@$connection->flush();
|
||||
unset($connection);
|
||||
unset($this->connection);
|
||||
}
|
||||
@@ -376,4 +376,4 @@ class cachestore_memcache extends cache_store implements cache_is_configurable {
|
||||
public function my_name() {
|
||||
return $this->name;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+2
-2
@@ -424,7 +424,7 @@ class cachestore_memcached extends cache_store implements cache_is_configurable
|
||||
$connection->addServers($this->servers);
|
||||
}
|
||||
}
|
||||
$connection->flush();
|
||||
@$connection->flush();
|
||||
unset($connection);
|
||||
unset($this->connection);
|
||||
}
|
||||
@@ -477,4 +477,4 @@ class cachestore_memcached extends cache_store implements cache_is_configurable
|
||||
public function my_name() {
|
||||
return $this->name;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+7
-1
@@ -463,7 +463,13 @@ class cachestore_mongodb extends cache_store implements cache_is_configurable {
|
||||
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();
|
||||
|
||||
Reference in New Issue
Block a user