Hallo Lars,
ich hoffe, dass diese Änderungen nicht die Performance von Multisite zu
stark beeinflusst. Es scheint so, dass bei jeder View die WATO-Daten
geladen werden - eventuell sogar mehrfach. Hier muss man evtl.
über Caches nachdenken (aber erst mal profilen...)
Mathias
Am 25.08.2011 09:33, schrieb Lars Michelsen:
Module: check_mk
Branch: master
Commit: b2de150d80321a3edc8c0c5261ff66490149eb38
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=b2de150d80321a…
Author: Lars Michelsen<lm(a)mathias-kettner.de>
Date: Thu Aug 25 09:28:39 2011 +0200
Added temporary workaround for not updated WATO titles in status GUIs
---
web/plugins/views/wato.py | 11 +++++++++++
1 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/web/plugins/views/wato.py b/web/plugins/views/wato.py
index 4d9bba6..827c13b 100644
--- a/web/plugins/views/wato.py
+++ b/web/plugins/views/wato.py
@@ -30,6 +30,9 @@ import wato
class FilterWatoFile(Filter):
def __init__(self):
Filter.__init__(self, "filename", "WATO Folder/File",
"host", ["filename"], [])
+ self.load_wato_data()
+
+ def load_wato_data(self):
self.tree = wato.api.get_folder_tree()
self.path_to_tree = {} # keep mapping from string-paths to folders/files
self.selection = self.folder_selection(self.tree, "", 0)
@@ -68,6 +71,14 @@ class FilterWatoFile(Filter):
return sel
def heading_info(self, info):
+ # FIXME: There is a problem with caching data and changing titles of WATO files
+ # Everything is changed correctly but the filter object is stored in the
+ # global multisite_filters var and self.path_to_tree is not refreshed when
+ # rendering this title. Thus the threads might have old information about the
+ # file titles and so on.
+ # The call below needs to use some sort of indicator wether the cache needs
+ # to be renewed or not.
+ self.load_wato_data()
current = html.var(self.name)
if current and current != "/":
return self.path_to_tree.get(current)
_______________________________________________
checkmk-commits mailing list
checkmk-commits(a)lists.mathias-kettner.de
http://lists.mathias-kettner.de/mailman/listinfo/checkmk-commits
--
Mathias Kettner GmbH
Registergericht: Amtsgericht München, HRB 165902
Firmensitz: Preysingstraße 74, 81667 München
Geschäftsführer: Mathias Kettner
Tel. 089 / 1890 4210
Fax 089 / 1890 4211
http://mathias-kettner.de