summary refs log tree commit diff
path: root/synapse/app
diff options
context:
space:
mode:
authorMark Haines <mark.haines@matrix.org>2016-06-16 12:53:15 +0100
committerMark Haines <mark.haines@matrix.org>2016-06-16 12:53:15 +0100
commit364d6167926d5d8b2a312e3d35623d2e05330e0a (patch)
tree20a0982d674169db75861eba08e0d76b969e8a38 /synapse/app
parentAccess replication_url from the worker config directly (diff)
downloadsynapse-364d6167926d5d8b2a312e3d35623d2e05330e0a.tar.xz
Access the event_cache_size directly from the server object.
This means that the workers can override the event_cache_size
directly without clobbering the value in the main synapse config.
Diffstat (limited to 'synapse/app')
-rw-r--r--synapse/app/pusher.py6
-rw-r--r--synapse/app/synchrotron.py6
2 files changed, 6 insertions, 6 deletions
diff --git a/synapse/app/pusher.py b/synapse/app/pusher.py
index a26a3bd394..5d4db4f892 100644
--- a/synapse/app/pusher.py
+++ b/synapse/app/pusher.py
@@ -18,7 +18,6 @@ import synapse
 
 from synapse.server import HomeServer
 from synapse.config._base import ConfigError
-from synapse.config.workers import clobber_with_worker_config
 from synapse.config.logger import setup_logging
 from synapse.config.homeserver import HomeServerConfig
 from synapse.http.site import SynapseSite
@@ -241,6 +240,9 @@ class PusherServer(HomeServer):
                 logger.exception("Error replicating from %r", replication_url)
                 yield sleep(30)
 
+    def get_event_cache_size(self):
+        return self.worker_config.event_cache_size
+
 
 def setup(worker_name, config_options):
     try:
@@ -255,8 +257,6 @@ def setup(worker_name, config_options):
 
     setup_logging(worker_config.log_config, worker_config.log_file)
 
-    clobber_with_worker_config(config, worker_config)
-
     if config.start_pushers:
         sys.stderr.write(
             "\nThe pushers must be disabled in the main synapse process"
diff --git a/synapse/app/synchrotron.py b/synapse/app/synchrotron.py
index 4443c73e6a..d10bb2b3f0 100644
--- a/synapse/app/synchrotron.py
+++ b/synapse/app/synchrotron.py
@@ -20,7 +20,6 @@ from synapse.api.constants import EventTypes, PresenceState
 from synapse.config._base import ConfigError
 from synapse.config.homeserver import HomeServerConfig
 from synapse.config.logger import setup_logging
-from synapse.config.workers import clobber_with_worker_config
 from synapse.events import FrozenEvent
 from synapse.handlers.presence import PresenceHandler
 from synapse.http.site import SynapseSite
@@ -404,6 +403,9 @@ class SynchrotronServer(HomeServer):
     def build_typing_handler(self):
         return SynchrotronTyping(self)
 
+    def get_event_cache_size(self):
+        return self.worker_config.event_cache_size
+
 
 def start(worker_name, config_options):
     try:
@@ -418,8 +420,6 @@ def start(worker_name, config_options):
 
     setup_logging(worker_config.log_config, worker_config.log_file)
 
-    clobber_with_worker_config(config, worker_config)
-
     database_engine = create_engine(config.database_config)
 
     ss = SynchrotronServer(