Implement running scheduled tasks

This commit is contained in:
2023-01-14 17:24:54 +00:00
parent 2a1e6b3292
commit 435d9b5571
3 changed files with 34 additions and 17 deletions

View File

@@ -153,7 +153,11 @@ class NotificationRuleData(object):
window_unit = window[-1]
if window_unit not in SECONDS_PER_UNIT:
raise RuleParseError(
f"Window unit must be one of {', '.join(SECONDS_PER_UNIT.keys())}, not '{window_unit}'",
(
"Window unit must be one of "
f"{', '.join(SECONDS_PER_UNIT.keys())},"
f" not '{window_unit}'"
),
"window",
)
window_seconds = window_number * SECONDS_PER_UNIT[window_unit]