diff options
author | Erik Johnston <erik@matrix.org> | 2016-11-21 11:28:37 +0000 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2016-11-21 11:33:08 +0000 |
commit | 7c9cdb22453d1a442e5c280149aeeff4d46da215 (patch) | |
tree | 1434dca32f57320810b5e70314db521f5cc7a338 /synapse/storage/stream.py | |
parent | Handle sending events and device messages over federation (diff) | |
download | synapse-7c9cdb22453d1a442e5c280149aeeff4d46da215.tar.xz |
Store federation stream positions in the database
Diffstat (limited to '')
-rw-r--r-- | synapse/storage/stream.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/synapse/storage/stream.py b/synapse/storage/stream.py index f34cb78f9a..7fa63b58a7 100644 --- a/synapse/storage/stream.py +++ b/synapse/storage/stream.py @@ -796,3 +796,19 @@ class StreamStore(SQLBaseStore): events = yield self._get_events(event_ids) defer.returnValue((upper_bound, events)) + + def get_federation_out_pos(self, typ): + return self._simple_select_one_onecol( + table="federation_stream_position", + retcol="stream_id", + keyvalues={"type": typ}, + desc="get_federation_out_pos" + ) + + def update_federation_out_pos(self, typ, stream_id): + return self._simple_update_one( + table="federation_stream_position", + keyvalues={"type": typ}, + updatevalues={"stream_id": stream_id}, + desc="update_federation_out_pos", + ) |