mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-03 00:24:54 -04:00
Shuffle persist event data store functions. (#7440)
The aim here is to get to a stage where we have a `PersistEventStore` that holds all the write methods used during event persistence, so that we can take that class out of the `DataStore` mixin and instansiate it separately. This will allow us to instansiate it on processes other than master, while also ensuring it is only available on processes that are configured to write to events stream. This is a bit of an architectural change, where we end up with multiple classes per data store (rather than one per data store we have now). We end up having: 1. Storage classes that provide high level APIs that can talk to multiple data stores. 2. Data store modules that consist of classes that must point at the same database instance. 3. Classes in a data store that can be instantiated on processes depending on config.
This commit is contained in:
parent
7ee24c5674
commit
782e4e64df
19 changed files with 1399 additions and 1258 deletions
|
@ -35,6 +35,7 @@ class EventPushActionsStoreTestCase(tests.unittest.TestCase):
|
|||
def setUp(self):
|
||||
hs = yield tests.utils.setup_test_homeserver(self.addCleanup)
|
||||
self.store = hs.get_datastore()
|
||||
self.persist_events_store = hs.get_datastores().persist_events
|
||||
|
||||
@defer.inlineCallbacks
|
||||
def test_get_unread_push_actions_for_user_in_range_for_http(self):
|
||||
|
@ -76,7 +77,7 @@ class EventPushActionsStoreTestCase(tests.unittest.TestCase):
|
|||
)
|
||||
yield self.store.db.runInteraction(
|
||||
"",
|
||||
self.store._set_push_actions_for_event_and_users_txn,
|
||||
self.persist_events_store._set_push_actions_for_event_and_users_txn,
|
||||
[(event, None)],
|
||||
[(event, None)],
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue