Store federation stream positions in the database

This commit is contained in:
Erik Johnston 2016-11-21 11:28:37 +00:00
parent f8ee66250a
commit 7c9cdb2245
6 changed files with 95 additions and 25 deletions

View file

@ -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",
)