diff options
author | Erik Johnston <erikj@jki.re> | 2017-04-26 14:02:06 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-26 14:02:06 +0100 |
commit | 7239258ae66f78530d96dc3a0e76387a546393f5 (patch) | |
tree | 8230189cf0ddb06ed08cffe1be41631c40c4f79a | |
parent | document how to make IPv6 work (#2088) (diff) | |
parent | Make state caches cache in ascii (diff) | |
download | synapse-7239258ae66f78530d96dc3a0e76387a546393f5.tar.xz |
Merge pull request #2160 from matrix-org/erikj/reduce_join_cache_size
Make state caches cache in ascii
Diffstat (limited to '')
-rw-r--r-- | synapse/storage/state.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/synapse/storage/state.py b/synapse/storage/state.py index e89001d994..a16afa8df5 100644 --- a/synapse/storage/state.py +++ b/synapse/storage/state.py @@ -16,6 +16,7 @@ from ._base import SQLBaseStore from synapse.util.caches.descriptors import cached, cachedList from synapse.util.caches import intern_string +from synapse.util.stringutils import to_ascii from synapse.storage.engines import PostgresEngine from twisted.internet import defer @@ -89,7 +90,7 @@ class StateStore(SQLBaseStore): ) return { - (r[0], r[1]): r[2] for r in txn + (intern_string(r[0]), intern_string(r[1])): to_ascii(r[2]) for r in txn } return self.runInteraction( @@ -655,7 +656,7 @@ class StateStore(SQLBaseStore): state_dict = results[group] state_dict.update( - ((intern_string(k[0]), intern_string(k[1])), v) + ((intern_string(k[0]), intern_string(k[1])), to_ascii(v)) for k, v in group_state_dict.iteritems() ) |