Module: check_mk
Branch: master
Commit: c040cb121ffe1c2989deaefbaafeeb3d75c7210b
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=c040cb121ffe1c…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Wed Nov 14 09:56:50 2018 +0100
added WK6683: Improved performance during activate changes
Change-Id: I7e2c748ddbaefff15704c3162b71a1abc78d8567
---
.werks/6683 | 12 ++++++++++++
cmk/gui/watolib.py | 7 ++++---
2 files changed, 16 insertions(+), 3 deletions(-)
diff --git a/.werks/6683 b/.werks/6683
new file mode 100644
index 0000000..e05584f
--- /dev/null
+++ b/.werks/6683
@@ -0,0 +1,12 @@
+Title: Improved performance during activate changes
+Level: 1
+Component: wato
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.6.0i1
+Date: 1542182491
+
+The duration of the activate changes phase was highly influenced by the number of WATO
snapshots on disk.
+This has been fixed.
diff --git a/cmk/gui/watolib.py b/cmk/gui/watolib.py
index 084ea7b..077a464 100644
--- a/cmk/gui/watolib.py
+++ b/cmk/gui/watolib.py
@@ -6221,7 +6221,7 @@ def do_snapshot_maintenance():
snapshots = []
for f in os.listdir(snapshot_dir):
if f.startswith('wato-snapshot-'):
- status = get_snapshot_status(f)
+ status = get_snapshot_status(f, check_correct_core=False)
# only remove automatic and legacy snapshots
if status.get("type") in ["automatic",
"legacy"]:
snapshots.append(f)
@@ -6234,7 +6234,7 @@ def do_snapshot_maintenance():
# Returns status information for snapshots or snapshots in progress
# TODO: Remove once new changes mechanism has been implemented
-def get_snapshot_status(snapshot, validate_checksums=False):
+def get_snapshot_status(snapshot, validate_checksums=False, check_correct_core=True):
if isinstance(snapshot, tuple):
name, file_stream = snapshot
else:
@@ -6408,7 +6408,8 @@ def get_snapshot_status(snapshot, validate_checksums=False):
check_size()
check_extension()
check_content()
- check_core()
+ if check_correct_core:
+ check_core()
if validate_checksums:
check_checksums()