]> git.mxchange.org Git - friendica.git/commitdiff
Quit if database connection was lost during "e"
authorMichael <heluecht@pirati.ca>
Mon, 11 Jun 2018 03:56:19 +0000 (03:56 +0000)
committerMichael <heluecht@pirati.ca>
Mon, 11 Jun 2018 03:56:19 +0000 (03:56 +0000)
include/dba.php

index b21b01b6db985720b925ff8aa81a36089d5ae55d..c0617af8e83524b74b7298ded87bbe68faac0c4d 100644 (file)
@@ -598,6 +598,13 @@ class dba {
                        logger('DB Error '.self::$errorno.': '.self::$error."\n".
                                System::callstack(8)."\n".self::replaceParameters($sql, $params));
 
+                       // On a lost connection we simply quit.
+                       // A reconnect like in self::p could be dangerous with modifications
+                       if ($errorno == 2006) {
+                               logger('Giving up because of database error '.$errorno.': '.$error);
+                               exit(1);
+                       }
+
                        self::$error = $error;
                        self::$errorno = $errorno;
                }