diff options
author | Richard van der Hoff <richard@matrix.org> | 2019-03-27 21:58:03 +0000 |
---|---|---|
committer | Richard van der Hoff <richard@matrix.org> | 2019-03-27 21:58:03 +0000 |
commit | 015b3622ebbea118baebc457227e355913a5702f (patch) | |
tree | 7ee18b6ed6cddff840a74e0d742b2c1c06c0dd93 /synapse/replication/tcp/streams/_base.py | |
parent | Add parse_row method to replication stream class (diff) | |
download | synapse-015b3622ebbea118baebc457227e355913a5702f.tar.xz |
Skip building a ROW_TYPE when building updates
We're about to turn it straight into a JSON object anyway so building a ROW_TYPE is a bit pointless, and reduces flexibility in the update_function.
Diffstat (limited to 'synapse/replication/tcp/streams/_base.py')
-rw-r--r-- | synapse/replication/tcp/streams/_base.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/synapse/replication/tcp/streams/_base.py b/synapse/replication/tcp/streams/_base.py index 25c3a23664..13ab1bee05 100644 --- a/synapse/replication/tcp/streams/_base.py +++ b/synapse/replication/tcp/streams/_base.py @@ -112,7 +112,7 @@ class Stream(object): time it was called up until the point `advance_current_token` was called. """ NAME = None # The name of the stream - ROW_TYPE = None # The type of the row + ROW_TYPE = None # The type of the row. Used by the default impl of parse_row. _LIMITED = True # Whether the update function takes a limit @classmethod @@ -201,7 +201,7 @@ class Stream(object): from_token, current_token, ) - updates = [(row[0], self.ROW_TYPE(*row[1:])) for row in rows] + updates = [(row[0], row[1:]) for row in rows] # check we didn't get more rows than the limit. # doing it like this allows the update_function to be a generator. |