summary refs log tree commit diff
path: root/synapse/storage/databases/main/push_rule.py
diff options
context:
space:
mode:
authorAndrew Morgan <andrew@amorgan.xyz>2020-10-21 14:15:38 +0100
committerAndrew Morgan <andrew@amorgan.xyz>2020-10-21 14:15:38 +0100
commit3729b15a64ab8c07c617211634e089ce7cb65bfb (patch)
tree8b2edfae721c38cade17333a840ed09540aa05ba /synapse/storage/databases/main/push_rule.py
parentMerge commit '4325be1a5' into anoa/dinsic_release_1_21_x (diff)
parentFactor out `_send_dummy_event_for_room` (#8370) (diff)
downloadsynapse-3729b15a64ab8c07c617211634e089ce7cb65bfb.tar.xz
Merge commit '2983049a7' into anoa/dinsic_release_1_21_x
* commit '2983049a7':
  Factor out `_send_dummy_event_for_room` (#8370)
  Improve logging of state resolution (#8371)
  Fix bug which caused failure on join with malformed membership events (#8385)
  Use `async with` for ID gens (#8383)
  Don't push if an user account has expired (#8353)
  Do not check lint/test dependencies at runtime. (#8377)
  Add note to reverse_proxy.md about disabling Apache's mod_security2 (#8375)
  Changelog
Diffstat (limited to 'synapse/storage/databases/main/push_rule.py')
-rw-r--r--synapse/storage/databases/main/push_rule.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/synapse/storage/databases/main/push_rule.py b/synapse/storage/databases/main/push_rule.py

index e20a16f907..711d5aa23d 100644 --- a/synapse/storage/databases/main/push_rule.py +++ b/synapse/storage/databases/main/push_rule.py
@@ -338,7 +338,7 @@ class PushRuleStore(PushRulesWorkerStore): ) -> None: conditions_json = json_encoder.encode(conditions) actions_json = json_encoder.encode(actions) - with await self._push_rules_stream_id_gen.get_next() as stream_id: + async with self._push_rules_stream_id_gen.get_next() as stream_id: event_stream_ordering = self._stream_id_gen.get_current_token() if before or after: @@ -585,7 +585,7 @@ class PushRuleStore(PushRulesWorkerStore): txn, stream_id, event_stream_ordering, user_id, rule_id, op="DELETE" ) - with await self._push_rules_stream_id_gen.get_next() as stream_id: + async with self._push_rules_stream_id_gen.get_next() as stream_id: event_stream_ordering = self._stream_id_gen.get_current_token() await self.db_pool.runInteraction( @@ -616,7 +616,7 @@ class PushRuleStore(PushRulesWorkerStore): Raises: NotFoundError if the rule does not exist. """ - with await self._push_rules_stream_id_gen.get_next() as stream_id: + async with self._push_rules_stream_id_gen.get_next() as stream_id: event_stream_ordering = self._stream_id_gen.get_current_token() await self.db_pool.runInteraction( "_set_push_rule_enabled_txn", @@ -754,7 +754,7 @@ class PushRuleStore(PushRulesWorkerStore): data={"actions": actions_json}, ) - with await self._push_rules_stream_id_gen.get_next() as stream_id: + async with self._push_rules_stream_id_gen.get_next() as stream_id: event_stream_ordering = self._stream_id_gen.get_current_token() await self.db_pool.runInteraction(