Skip to content

Commit d84284c

Browse files
committed
Updating edit_monitor{) to let SWAG start even with broken monitor.
1 parent 7d423dd commit d84284c

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

root/app/auto_uptime_kuma/uptime_kuma_service.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,13 @@ def edit_monitor(self, container_name, monitor_data):
169169
is actually "delete" followed by "add"
170170
so that in the end the monitors are actually recreated
171171
"""
172-
new_monitor_data = self.build_monitor_data(container_name, monitor_data)
172+
try:
173+
new_monitor_data = self.build_monitor_data(container_name, monitor_data)
174+
self.validate_monitor_data(new_monitor_data)
175+
except Exception as e:
176+
Log.info(f"Invalid monitor data for '{container_name}'. Skipping edit. Reason: {e}")
177+
return
178+
173179
existing_monitor_data = self.get_monitor(container_name)
174180
old_content = self.config_service.read_config_content(container_name)
175181
new_content = self.config_service.build_config_content(new_monitor_data)

0 commit comments

Comments
 (0)