summary refs log tree commit diff
path: root/synapse/replication
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2018-03-19 16:06:02 +0000
committerErik Johnston <erik@matrix.org>2018-03-19 16:12:48 +0000
commit610accbb7f58d7a07007dedaa054c8ad7a9f5851 (patch)
tree5c1c0fddd1691a29e2c7ef19819f66a54e849c53 /synapse/replication
parentMerge pull request #3005 from matrix-org/erikj/fix_cache_size (diff)
downloadsynapse-610accbb7f58d7a07007dedaa054c8ad7a9f5851.tar.xz
Fix replication after switch to simplejson
Turns out that simplejson serialises namedtuple's as dictionaries rather
than tuples by default.
Diffstat (limited to 'synapse/replication')
-rw-r--r--synapse/replication/tcp/commands.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/synapse/replication/tcp/commands.py b/synapse/replication/tcp/commands.py
index 9633404f73..1b4b657210 100644
--- a/synapse/replication/tcp/commands.py
+++ b/synapse/replication/tcp/commands.py
@@ -107,7 +107,7 @@ class RdataCommand(Command):
         return " ".join((
             self.stream_name,
             str(self.token) if self.token is not None else "batch",
-            json.dumps(self.row),
+            json.dumps(self.row, namedtuple_as_object=False),
         ))
 
 
@@ -301,7 +301,9 @@ class InvalidateCacheCommand(Command):
         return cls(cache_func, json.loads(keys_json))
 
     def to_line(self):
-        return " ".join((self.cache_func, json.dumps(self.keys)))
+        return " ".join((
+            self.cache_func, json.dumps(self.keys, namedtuple_as_object=False)
+        ))
 
 
 class UserIpCommand(Command):