summary refs log tree commit diff
path: root/synapse/events/__init__.py
diff options
context:
space:
mode:
authorNeil Johnson <neil@matrix.org>2018-10-04 17:26:59 +0100
committerGitHub <noreply@github.com>2018-10-04 17:26:59 +0100
commited82043efb5456dc03a6a9969b7e4f3f941a6c67 (patch)
tree5c2b73172bc4deefb9efb6de8c8e59cc184d1263 /synapse/events/__init__.py
parentmove logic into register, fix room alias localpart bug, tests (diff)
parentMerge pull request #3995 from matrix-org/rav/no_deextrem_outliers (diff)
downloadsynapse-ed82043efb5456dc03a6a9969b7e4f3f941a6c67.tar.xz
Merge branch 'develop' into matthew/autocreate_autojoin
Diffstat (limited to 'synapse/events/__init__.py')
-rw-r--r--synapse/events/__init__.py13
1 files changed, 10 insertions, 3 deletions
diff --git a/synapse/events/__init__.py b/synapse/events/__init__.py
index b782af6308..12f1eb0a3e 100644
--- a/synapse/events/__init__.py
+++ b/synapse/events/__init__.py
@@ -13,15 +13,22 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+import os
+from distutils.util import strtobool
+
 import six
 
 from synapse.util.caches import intern_dict
 from synapse.util.frozenutils import freeze
 
 # Whether we should use frozen_dict in FrozenEvent. Using frozen_dicts prevents
-# bugs where we accidentally share e.g. signature dicts. However, converting
-# a dict to frozen_dicts is expensive.
-USE_FROZEN_DICTS = True
+# bugs where we accidentally share e.g. signature dicts. However, converting a
+# dict to frozen_dicts is expensive.
+#
+# NOTE: This is overridden by the configuration by the Synapse worker apps, but
+# for the sake of tests, it is set here while it cannot be configured on the
+# homeserver object itself.
+USE_FROZEN_DICTS = strtobool(os.environ.get("SYNAPSE_USE_FROZEN_DICTS", "0"))
 
 
 class _EventInternalMetadata(object):