Module: check_mk
Branch: master
Commit: fa8f5c360face492d8474c6d403ad06399fa8524
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=fa8f5c360face4…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Sep 27 08:33:47 2012 +0200
FIX: BI - Fixed cache reload after monitoring daemon restart
---
web/htdocs/bi.py | 13 +++++++------
1 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/web/htdocs/bi.py b/web/htdocs/bi.py
index f1231bd..f6dbc32 100644
--- a/web/htdocs/bi.py
+++ b/web/htdocs/bi.py
@@ -206,16 +206,17 @@ def compile_forest(user, only_hosts = None, only_groups = None):
def log(s):
file(config.bi_compile_log, "a").write(s)
- if g_compiled_everything:
- log('PID: %d - Already compiled everything\n' % os.getpid())
- return # In this case simply skip further compilations
-
new_config_information = cache_needs_update()
- if new_config_information: # config changed are Nagios restarted, clear cache
- global g_cache
+ if new_config_information:
+ # config changed or monitoring daemon restarted, clear cache
g_cache = {}
global g_config_information
g_config_information = new_config_information
+ g_compiled_everything = False
+
+ if g_compiled_everything:
+ log('PID: %d - Already compiled everything\n' % os.getpid())
+ return # In this case simply skip further compilations
# OPTIMIZE: All users that have the permissing bi.see_all
# can use the same cache.