summary refs log tree commit diff
path: root/synapse/config/workers.py
diff options
context:
space:
mode:
authorErik Johnston <erikj@jki.re>2017-01-20 11:55:56 +0000
committerGitHub <noreply@github.com>2017-01-20 11:55:56 +0000
commit86063d4321c999549139a113a55abcf0042c8b85 (patch)
tree44f3edaf1d5a50c13284d03938cb4034c39778a3 /synapse/config/workers.py
parentMerge pull request #1832 from xsteadfastx/xsteadfastx/turn-username-password (diff)
parentMake worker listener config backwards compat (diff)
downloadsynapse-86063d4321c999549139a113a55abcf0042c8b85.tar.xz
Merge pull request #1835 from matrix-org/erikj/fix_workers
Make worker listener config backwards compat
Diffstat (limited to 'synapse/config/workers.py')
-rw-r--r--synapse/config/workers.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/synapse/config/workers.py b/synapse/config/workers.py
index 904789d155..b165c67ee7 100644
--- a/synapse/config/workers.py
+++ b/synapse/config/workers.py
@@ -29,3 +29,13 @@ class WorkerConfig(Config):
         self.worker_log_file = config.get("worker_log_file")
         self.worker_log_config = config.get("worker_log_config")
         self.worker_replication_url = config.get("worker_replication_url")
+
+        if self.worker_listeners:
+            for listener in self.worker_listeners:
+                bind_address = listener.pop("bind_address", None)
+                bind_addresses = listener.setdefault("bind_addresses", [])
+
+                if bind_address:
+                    bind_addresses.append(bind_address)
+                elif not bind_addresses:
+                    bind_addresses.append('')