summary refs log tree commit diff
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2016-06-08 10:05:56 +0100
committerErik Johnston <erik@matrix.org>2016-06-08 10:05:56 +0100
commite0fda29f9455f1b04e3960f020941f7bc18dc5ca (patch)
tree715ef91066fd1c785cab632257063365835c9b58
parentMerge pull request #852 from matrix-org/erikj/gc_metrics (diff)
parentAdd gc_threshold to pusher and synchrotron (diff)
downloadsynapse-e0fda29f9455f1b04e3960f020941f7bc18dc5ca.tar.xz
Merge pull request #850 from matrix-org/erikj/gc_threshold
Add gc_threshold to pusher and synchrotron
-rw-r--r--synapse/app/pusher.py14
-rw-r--r--synapse/app/synchrotron.py14
2 files changed, 28 insertions, 0 deletions
diff --git a/synapse/app/pusher.py b/synapse/app/pusher.py
index 7e2bf7ecc2..4ec23d84c1 100644
--- a/synapse/app/pusher.py
+++ b/synapse/app/pusher.py
@@ -65,6 +65,20 @@ class SlaveConfig(DatabaseConfig):
         self.pid_file = self.abspath(config.get("pid_file"))
         self.public_baseurl = config["public_baseurl"]
 
+        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
+
         # some things used by the auth handler but not actually used in the
         # pusher codebase
         self.bcrypt_rounds = None
diff --git a/synapse/app/synchrotron.py b/synapse/app/synchrotron.py
index f9673ab8d8..297e199453 100644
--- a/synapse/app/synchrotron.py
+++ b/synapse/app/synchrotron.py
@@ -78,6 +78,20 @@ class SynchrotronConfig(DatabaseConfig, LoggingConfig, AppServiceConfig):
         self.macaroon_secret_key = config["macaroon_secret_key"]
         self.expire_access_token = config.get("expire_access_token", False)
 
+        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
+
     def default_config(self, server_name, **kwargs):
         pid_file = self.abspath("synchroton.pid")
         return """\