Module: check_mk
Branch: master
Commit: af5670b857245e2e123e86ec495403c406c5926a
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=af5670b857245e…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Feb 12 17:24:00 2016 +0100
re-added livestatus connection cleanup after request finished
---
web/htdocs/index.py | 3 +++
web/htdocs/sites.py | 6 ++++++
2 files changed, 9 insertions(+)
diff --git a/web/htdocs/index.py b/web/htdocs/index.py
index 25bd189..b125d6f 100644
--- a/web/htdocs/index.py
+++ b/web/htdocs/index.py
@@ -27,6 +27,7 @@
from mod_python import apache
import sys, os, pprint, __builtin__
import i18n
+import sites
import livestatus
import modules
import defaults, config, login
@@ -167,6 +168,7 @@ def handler(req, fields = None, is_profiling = False):
(apache.SERVER_RETURN, apache.HTTP_UNAUTHORIZED),
(apache.SERVER_RETURN, apache.HTTP_MOVED_TEMPORARILY)):
release_all_locks()
+ sites.disconnect()
html.finalize(is_error=True)
raise
@@ -184,6 +186,7 @@ def handler(req, fields = None, is_profiling = False):
response_code = apache.OK
release_all_locks()
+ sites.disconnect()
html.finalize()
return response_code
diff --git a/web/htdocs/sites.py b/web/htdocs/sites.py
index 08d19ee..9b1b784 100644
--- a/web/htdocs/sites.py
+++ b/web/htdocs/sites.py
@@ -169,6 +169,12 @@ def set_livestatus_auth():
_live.set_auth_domain('read')
+def disconnect():
+ global _live, _site_status
+ _live = None
+ _site_status = None
+
+
def status_host_state_name(shs):
if shs == None:
return "dead"