summaryrefslogtreecommitdiffstats
path: root/lib/private/db.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/db.php')
-rw-r--r--lib/private/db.php10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/private/db.php b/lib/private/db.php
index 6aaf31a30cd..221a369cad2 100644
--- a/lib/private/db.php
+++ b/lib/private/db.php
@@ -106,6 +106,16 @@ class OC_DB {
}
/**
+ * The existing database connection is closed and connected again
+ */
+ public static function reconnect() {
+ if(self::$connection) {
+ self::$connection->close();
+ self::$connection->connect();
+ }
+ }
+
+ /**
* @return \OC\DB\Connection
*/
static public function getConnection() {