mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2024-12-26 03:19:24 -05:00
Make be faster
This commit is contained in:
parent
ed80c6b6cc
commit
269af961e9
@ -112,11 +112,11 @@ class BulkPushRuleEvaluator(object):
|
|||||||
|
|
||||||
@defer.inlineCallbacks
|
@defer.inlineCallbacks
|
||||||
def _get_sender_power_level(self, event, context):
|
def _get_sender_power_level(self, event, context):
|
||||||
pl_event_key = (EventTypes.PowerLevels, "", )
|
pl_event_id = context.prev_state_ids.get((EventTypes.PowerLevels, "",))
|
||||||
if pl_event_key in context.prev_state_ids:
|
if pl_event_id:
|
||||||
# fastpath: if there's a power level event, that's all we need, and
|
# fastpath: if there's a power level event, that's all we need, and
|
||||||
# not having a power level event is an extreme edge case
|
# not having a power level event is an extreme edge case
|
||||||
auth_events_ids = [context.prev_state_ids[pl_event_key]]
|
auth_events_ids = [pl_event_id]
|
||||||
else:
|
else:
|
||||||
auth_events_ids = yield self.auth.compute_auth_events(
|
auth_events_ids = yield self.auth.compute_auth_events(
|
||||||
event, context.prev_state_ids, for_verification=False,
|
event, context.prev_state_ids, for_verification=False,
|
||||||
|
Loading…
Reference in New Issue
Block a user