Merge pull request #1174 from matrix-org/erikj/email_push_noop

Reduce redundant database work in email pusher
This commit is contained in:
Erik Johnston 2016-10-18 15:27:10 +01:00 committed by GitHub
commit f6955db970
2 changed files with 5 additions and 1 deletions

View File

@ -150,6 +150,10 @@ class EmailPusher(object):
soonest_due_at = None soonest_due_at = None
if not unprocessed:
yield self.save_last_stream_ordering_and_success(self.max_stream_ordering)
return
for push_action in unprocessed: for push_action in unprocessed:
received_at = push_action['received_ts'] received_at = push_action['received_ts']
if received_at is None: if received_at is None:

View File

@ -372,7 +372,7 @@ class Mailer(object):
state_event_id = room_state_ids[room_id][ state_event_id = room_state_ids[room_id][
("m.room.member", event.sender) ("m.room.member", event.sender)
] ]
state_event = yield self.get_event(state_event_id) state_event = yield self.store.get_event(state_event_id)
sender_name = name_from_member_event(state_event) sender_name = name_from_member_event(state_event)
if sender_name is not None and room_name is not None: if sender_name is not None and room_name is not None: