diff options
author | Erik Johnston <erik@matrix.org> | 2016-11-17 15:46:44 +0000 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2016-11-17 15:48:04 +0000 |
commit | f8ee66250a16cb9dd3af01fb1150ff18cfebbc39 (patch) | |
tree | 9920bd4e8164f705b4e27c714d6c053082dcf7a5 /synapse/replication/slave/storage/events.py | |
parent | Hook up the send queue and create a federation sender worker (diff) | |
download | synapse-f8ee66250a16cb9dd3af01fb1150ff18cfebbc39.tar.xz |
Handle sending events and device messages over federation
Diffstat (limited to 'synapse/replication/slave/storage/events.py')
-rw-r--r-- | synapse/replication/slave/storage/events.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/synapse/replication/slave/storage/events.py b/synapse/replication/slave/storage/events.py index 0c26e96e98..ef8713b55d 100644 --- a/synapse/replication/slave/storage/events.py +++ b/synapse/replication/slave/storage/events.py @@ -26,6 +26,11 @@ from synapse.storage.stream import StreamStore from synapse.util.caches.stream_change_cache import StreamChangeCache import ujson as json +import logging + + +logger = logging.getLogger(__name__) + # So, um, we want to borrow a load of functions intended for reading from # a DataStore, but we don't want to take functions that either write to the @@ -180,6 +185,8 @@ class SlavedEventStore(BaseSlavedStore): EventFederationStore.__dict__["_get_forward_extremeties_for_room"] ) + get_all_new_events_stream = DataStore.get_all_new_events_stream.__func__ + def stream_positions(self): result = super(SlavedEventStore, self).stream_positions() result["events"] = self._stream_id_gen.get_current_token() @@ -194,6 +201,10 @@ class SlavedEventStore(BaseSlavedStore): stream = result.get("events") if stream: self._stream_id_gen.advance(int(stream["position"])) + + if stream["rows"]: + logger.info("Got %d event rows", len(stream["rows"])) + for row in stream["rows"]: self._process_replication_row( row, backfilled=False, state_resets=state_resets |