Support sending messages when a rule no longer matches and fix dual-use notification sender

This commit is contained in:
2023-01-16 00:10:41 +00:00
parent 75603570ff
commit a2207bbcf4
6 changed files with 173 additions and 63 deletions

View File

@@ -2,7 +2,7 @@ import msgpack
from django.core.management.base import BaseCommand
from redis import StrictRedis
from core.lib.rules import rule_matched
from core.lib.rules import rule_notify
from core.models import NotificationRule
from core.util import logs
@@ -70,7 +70,7 @@ def process_rules(data):
matched_field_number += 1
matched[field] = message[field]
if matched_field_number == rule_field_length - 2:
rule_matched(rule, message, matched)
rule_notify(rule, index, message, matched)
class Command(BaseCommand):