From 37eaf9c27271197320d4bedcceaf58d746935e53 Mon Sep 17 00:00:00 2001 From: Patrick Cloke Date: Tue, 5 Jan 2021 10:53:15 -0500 Subject: Fix-up assertions about last stream token in push (#9020) The last stream token is always known and we do not need to handle none. --- synapse/push/pusherpool.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'synapse/push/pusherpool.py') diff --git a/synapse/push/pusherpool.py b/synapse/push/pusherpool.py index 8158356d40..eed16dbfb5 100644 --- a/synapse/push/pusherpool.py +++ b/synapse/push/pusherpool.py @@ -106,6 +106,10 @@ class PusherPool: time_now_msec = self.clock.time_msec() + # create the pusher setting last_stream_ordering to the current maximum + # stream ordering, so it will process pushes from this point onwards. + last_stream_ordering = self.store.get_room_max_stream_ordering() + # we try to create the pusher just to validate the config: it # will then get pulled out of the database, # recreated, added and started: this means we have only one @@ -124,16 +128,12 @@ class PusherPool: ts=time_now_msec, lang=lang, data=data, - last_stream_ordering=None, + last_stream_ordering=last_stream_ordering, last_success=None, failing_since=None, ) ) - # create the pusher setting last_stream_ordering to the current maximum - # stream ordering, so it will process pushes from this point onwards. - last_stream_ordering = self.store.get_room_max_stream_ordering() - await self.store.add_pusher( user_id=user_id, access_token=access_token, -- cgit 1.4.1