Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Split out get_events and co into a worker store
Browse files Browse the repository at this point in the history
  • Loading branch information
erikjohnston committed Feb 21, 2018
1 parent a2b25de commit 27b094f
Show file tree
Hide file tree
Showing 2 changed files with 1,206 additions and 1,210 deletions.
13 changes: 2 additions & 11 deletions synapse/replication/slave/storage/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
from synapse.storage import DataStore
from synapse.storage.event_federation import EventFederationStore
from synapse.storage.event_push_actions import EventPushActionsStore
from synapse.storage.events import EventsWorkerStore
from synapse.storage.roommember import RoomMemberStore
from synapse.storage.state import StateGroupWorkerStore
from synapse.storage.stream import StreamStore
Expand All @@ -38,7 +39,7 @@
# the method descriptor on the DataStore and chuck them into our class.


class SlavedEventStore(StateGroupWorkerStore, BaseSlavedStore):
class SlavedEventStore(EventsWorkerStore, StateGroupWorkerStore, BaseSlavedStore):

def __init__(self, db_conn, hs):
super(SlavedEventStore, self).__init__(db_conn, hs)
Expand Down Expand Up @@ -104,8 +105,6 @@ def __init__(self, db_conn, hs):
get_push_action_users_in_range = (
DataStore.get_push_action_users_in_range.__func__
)
get_event = DataStore.get_event.__func__
get_events = DataStore.get_events.__func__
get_rooms_for_user_where_membership_is = (
DataStore.get_rooms_for_user_where_membership_is.__func__
)
Expand Down Expand Up @@ -135,14 +134,6 @@ def __init__(self, db_conn, hs):

_set_before_and_after = staticmethod(DataStore._set_before_and_after)

_get_events = DataStore._get_events.__func__
_get_events_from_cache = DataStore._get_events_from_cache.__func__

_invalidate_get_event_cache = DataStore._invalidate_get_event_cache.__func__
_enqueue_events = DataStore._enqueue_events.__func__
_do_fetch = DataStore._do_fetch.__func__
_fetch_event_rows = DataStore._fetch_event_rows.__func__
_get_event_from_row = DataStore._get_event_from_row.__func__
_get_rooms_for_user_where_membership_is_txn = (
DataStore._get_rooms_for_user_where_membership_is_txn.__func__
)
Expand Down
Loading

0 comments on commit 27b094f

Please sign in to comment.