diff options
author | Erik Johnston <erik@matrix.org> | 2016-06-20 14:13:54 +0100 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2016-06-20 14:13:54 +0100 |
commit | 00c281f6a481671c8c37b17aa4ec7216bc551b27 (patch) | |
tree | 95d3dceb57e2edf136192ad32f7a7ccadbdbbeb1 /synapse/config/server.py | |
parent | Update change log (diff) | |
parent | Merge pull request #880 from matrix-org/markjh/registered_user (diff) | |
download | synapse-00c281f6a481671c8c37b17aa4ec7216bc551b27.tar.xz |
Merge branch 'develop' of github.com:matrix-org/synapse into release-v0.16.1
Diffstat (limited to 'synapse/config/server.py')
-rw-r--r-- | synapse/config/server.py | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/synapse/config/server.py b/synapse/config/server.py index 44b8d422e0..7840dc3ad6 100644 --- a/synapse/config/server.py +++ b/synapse/config/server.py @@ -27,7 +27,7 @@ class ServerConfig(Config): self.daemonize = config.get("daemonize") self.print_pidfile = config.get("print_pidfile") self.user_agent_suffix = config.get("user_agent_suffix") - self.use_frozen_dicts = config.get("use_frozen_dicts", True) + self.use_frozen_dicts = config.get("use_frozen_dicts", False) self.public_baseurl = config.get("public_baseurl") self.secondary_directory_servers = config.get("secondary_directory_servers", []) @@ -38,19 +38,7 @@ class ServerConfig(Config): self.listeners = config.get("listeners", []) - thresholds = config.get("gc_thresholds", None) - if thresholds is not None: - try: - assert len(thresholds) == 3 - self.gc_thresholds = ( - int(thresholds[0]), int(thresholds[1]), int(thresholds[2]), - ) - except: - raise ConfigError( - "Value of `gc_threshold` must be a list of three integers if set" - ) - else: - self.gc_thresholds = None + self.gc_thresholds = read_gc_thresholds(config.get("gc_thresholds", None)) bind_port = config.get("bind_port") if bind_port: @@ -264,3 +252,20 @@ class ServerConfig(Config): type=int, help="Turn on the twisted telnet manhole" " service on the given port.") + + +def read_gc_thresholds(thresholds): + """Reads the three integer thresholds for garbage collection. Ensures that + the thresholds are integers if thresholds are supplied. + """ + if thresholds is None: + return None + try: + assert len(thresholds) == 3 + return ( + int(thresholds[0]), int(thresholds[1]), int(thresholds[2]), + ) + except: + raise ConfigError( + "Value of `gc_threshold` must be a list of three integers if set" + ) |