mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-08-06 04:54:15 -04:00
Use abstract base class to access stream IDs
This commit is contained in:
parent
f5ac4dc2d4
commit
e316bbb4c0
2 changed files with 34 additions and 17 deletions
|
@ -31,11 +31,16 @@ from synapse.storage.receipts import ReceiptsWorkerStore
|
|||
class SlavedReceiptsStore(ReceiptsWorkerStore, BaseSlavedStore):
|
||||
|
||||
def __init__(self, db_conn, hs):
|
||||
receipts_id_gen = SlavedIdTracker(
|
||||
# We instansiate this first as the ReceiptsWorkerStore constructor
|
||||
# needs to be able to call get_max_receipt_stream_id
|
||||
self._receipts_id_gen = SlavedIdTracker(
|
||||
db_conn, "receipts_linearized", "stream_id"
|
||||
)
|
||||
|
||||
super(SlavedReceiptsStore, self).__init__(receipts_id_gen, db_conn, hs)
|
||||
super(SlavedReceiptsStore, self).__init__(db_conn, hs)
|
||||
|
||||
def get_max_receipt_stream_id(self):
|
||||
return self._receipts_id_gen.get_current_token()
|
||||
|
||||
def stream_positions(self):
|
||||
result = super(SlavedReceiptsStore, self).stream_positions()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue