diff options
author | Erik Johnston <erikj@jki.re> | 2016-10-18 15:27:10 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-10-18 15:27:10 +0100 |
commit | f6955db970ec4846639b05ee9e49eef016da77db (patch) | |
tree | 86f50a1960352e2b46c4ea645ab5f56f7a5ce0eb /synapse | |
parent | Merge branch 'release-v0.18.2' of github.com:matrix-org/synapse into develop (diff) | |
parent | Fix push notifications for a single unread message (diff) | |
download | synapse-f6955db970ec4846639b05ee9e49eef016da77db.tar.xz |
Merge pull request #1174 from matrix-org/erikj/email_push_noop
Reduce redundant database work in email pusher
Diffstat (limited to 'synapse')
-rw-r--r-- | synapse/push/emailpusher.py | 4 | ||||
-rw-r--r-- | synapse/push/mailer.py | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/synapse/push/emailpusher.py b/synapse/push/emailpusher.py index 6600c9cd55..2eb325c7c7 100644 --- a/synapse/push/emailpusher.py +++ b/synapse/push/emailpusher.py @@ -150,6 +150,10 @@ class EmailPusher(object): 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: received_at = push_action['received_ts'] if received_at is None: diff --git a/synapse/push/mailer.py b/synapse/push/mailer.py index 3b63c19eca..53551632b6 100644 --- a/synapse/push/mailer.py +++ b/synapse/push/mailer.py @@ -372,7 +372,7 @@ class Mailer(object): state_event_id = room_state_ids[room_id][ ("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) if sender_name is not None and room_name is not None: |