Fix window/interval validation and make aggs optional in parse_results
This commit is contained in:
@@ -22,6 +22,9 @@ def raw_sendmsg(msg, title=None, priority=None, tags=None, url=None, topic=None)
|
||||
data=msg,
|
||||
headers=headers,
|
||||
)
|
||||
print("Sent notification to", url)
|
||||
print("topic", topic)
|
||||
print("msg", msg)
|
||||
except requests.exceptions.ConnectionError as e:
|
||||
log.error(f"Error sending notification: {e}")
|
||||
|
||||
|
||||
@@ -243,7 +243,7 @@ class NotificationRuleData(object):
|
||||
"Window cannot be specified with on-demand interval", "window"
|
||||
)
|
||||
|
||||
if interval is not None and window is None:
|
||||
if interval != 0 and window is None:
|
||||
raise RuleParseError(
|
||||
"Window must be specified with non-on-demand interval", "window"
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user