diff --git a/lib/action.php b/lib/action.php index 7d4e03915c..0563fe2163 100644 --- a/lib/action.php +++ b/lib/action.php @@ -302,7 +302,7 @@ class Action extends HTMLOutputter // lawsuit $this->script('jquery.form.min.js'); $this->script('jquery-ui.min.js'); $this->script('jquery.cookie.min.js'); - $this->inlineScript('if (typeof window.JSON !== "object") { $.getScript("'.common_path('js/json2.min.js').'"); }'); + $this->inlineScript('if (typeof window.JSON !== "object") { $.getScript("'.common_path('js/json2.min.js', StatusNet::isHTTPS()).'"); }'); $this->script('jquery.joverlay.min.js'); $this->script('jquery.infieldlabel.min.js'); } else { @@ -310,7 +310,7 @@ class Action extends HTMLOutputter // lawsuit $this->script('jquery.form.js'); $this->script('jquery-ui.min.js'); $this->script('jquery.cookie.js'); - $this->inlineScript('if (typeof window.JSON !== "object") { $.getScript("'.common_path('js/json2.js').'"); }'); + $this->inlineScript('if (typeof window.JSON !== "object") { $.getScript("'.common_path('js/json2.js', StatusNet::isHTTPS()).'"); }'); $this->script('jquery.joverlay.js'); $this->script('jquery.infieldlabel.js'); } diff --git a/lib/framework.php b/lib/framework.php index 69c1e4f6c8..8f5cdf31c6 100644 --- a/lib/framework.php +++ b/lib/framework.php @@ -159,6 +159,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/', $userInfo)) { + common_log(LOG_ERR, "Lost DB connection; dying."); + exit(100); + } + if ($err->getCode()) { throw new PEAR_Exception($err->getMessage(), $err->getCode()); }