Skip to content

Commit

Permalink
17278 FIX Service grouping long loading or timeout
Browse files Browse the repository at this point in the history
SUP-21609

Change-Id: I529266e8700c058a77d287cbcc68435d9fb5409c
  • Loading branch information
loocars committed Dec 17, 2024
1 parent d3f74c1 commit 6f89200
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 4 deletions.
18 changes: 18 additions & 0 deletions .werks/17278.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[//]: # (werk v2)
# Service grouping long loading or timeout

key | value
---------- | ---
date | 2024-12-17T13:07:27+00:00
version | 2.3.0p24
class | fix
edition | cre
component | multisite
level | 1
compatible | yes

When configuring the global setting "Grouping of services in table views"
with specific grouping expressions (for example `(?!.*(CPU)).*`) this could cause
long loading times or even timeouts of view.

This is now fixed and the grouping works as expected.
12 changes: 8 additions & 4 deletions cmk/gui/views/layout/layouts.py
Original file line number Diff line number Diff line change
Expand Up @@ -409,10 +409,14 @@ def try_to_match_group(row: Row) -> GroupSpec | None:
group_spec["pattern"], row["service_description"]
):
if re.findall(r"(\([^)]*\))", group_spec["pattern"]):
group_spec["title"] = re.sub(
group_spec["pattern"],
escape_regex_chars(group_spec["title"]),
row["service_description"],
return GroupSpec(
title=re.sub(
group_spec["pattern"],
escape_regex_chars(group_spec["title"]),
row["service_description"],
),
pattern=group_spec["pattern"],
min_items=group_spec["min_items"],
)
return group_spec

Expand Down

0 comments on commit 6f89200

Please sign in to comment.