die when we get a bad connection error
This commit is contained in:
parent
cab76836cb
commit
8cdbef098b
@ -160,6 +160,15 @@ function PEAR_ErrorToPEAR_Exception($err)
|
||||
|
||||
common_log(LOG_ERR, "PEAR Error: $msg ($userInfo)");
|
||||
|
||||
// HACK: queue handlers get kicked by the long-query killer, and
|
||||
// keep the same broken connection. We die here to get a new
|
||||
// process started.
|
||||
|
||||
if (php_sapi_name() == 'cli' && preg_match('/nativecode=2006/', $msg)) {
|
||||
common_log(LOG_ERR, "Lost DB connection; dying.");
|
||||
exit(100);
|
||||
}
|
||||
|
||||
if ($err->getCode()) {
|
||||
throw new PEAR_Exception($msg, $err, $err->getCode());
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user