mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 18:04:49 -04:00
Batch inserts into event_push_actions_staging
This commit is contained in:
parent
3fc33bae8b
commit
6ff8c87484
2 changed files with 45 additions and 23 deletions
|
@ -144,6 +144,7 @@ class BulkPushRuleEvaluator(object):
|
|||
Deferred
|
||||
"""
|
||||
rules_by_user = yield self._get_rules_for_event(event, context)
|
||||
actions_by_user = {}
|
||||
|
||||
room_members = yield self.store.get_joined_users_from_context(
|
||||
event, context
|
||||
|
@ -189,14 +190,16 @@ class BulkPushRuleEvaluator(object):
|
|||
if matches:
|
||||
actions = [x for x in rule['actions'] if x != 'dont_notify']
|
||||
if actions and 'notify' in actions:
|
||||
# Push rules say we should notify the user of this event,
|
||||
# so we mark it in the DB in the staging area. (This
|
||||
# will then get handled when we persist the event)
|
||||
yield self.store.add_push_actions_to_staging(
|
||||
event.event_id, uid, actions,
|
||||
)
|
||||
actions_by_user[uid] = actions
|
||||
break
|
||||
|
||||
# Push rules say we should notify the user of this event,
|
||||
# so we mark it in the DB in the staging area. (This
|
||||
# will then get handled when we persist the event)
|
||||
yield self.store.add_push_actions_to_staging(
|
||||
event.event_id, actions_by_user,
|
||||
)
|
||||
|
||||
|
||||
def _condition_checker(evaluator, conditions, uid, display_name, cache):
|
||||
for cond in conditions:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue