mirror of
https://mau.dev/maunium/synapse.git
synced 2024-10-01 01:36:05 -04:00
Merge pull request #850 from matrix-org/erikj/gc_threshold
Add gc_threshold to pusher and synchrotron
This commit is contained in:
commit
e0fda29f94
@ -65,6 +65,20 @@ class SlaveConfig(DatabaseConfig):
|
|||||||
self.pid_file = self.abspath(config.get("pid_file"))
|
self.pid_file = self.abspath(config.get("pid_file"))
|
||||||
self.public_baseurl = config["public_baseurl"]
|
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
|
# some things used by the auth handler but not actually used in the
|
||||||
# pusher codebase
|
# pusher codebase
|
||||||
self.bcrypt_rounds = None
|
self.bcrypt_rounds = None
|
||||||
|
@ -78,6 +78,20 @@ class SynchrotronConfig(DatabaseConfig, LoggingConfig, AppServiceConfig):
|
|||||||
self.macaroon_secret_key = config["macaroon_secret_key"]
|
self.macaroon_secret_key = config["macaroon_secret_key"]
|
||||||
self.expire_access_token = config.get("expire_access_token", False)
|
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):
|
def default_config(self, server_name, **kwargs):
|
||||||
pid_file = self.abspath("synchroton.pid")
|
pid_file = self.abspath("synchroton.pid")
|
||||||
return """\
|
return """\
|
||||||
|
Loading…
Reference in New Issue
Block a user