diff options
author | Matthew Hodgson <matthew@arasphere.net> | 2018-01-22 19:11:18 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-22 19:11:18 +0100 |
commit | ab9f844aaf3662a64dbc4c56077e9fa37bc7d5d0 (patch) | |
tree | df5417cbd46f5c9a386d4d762f83b06d58afda17 /synapse/util | |
parent | Merge pull request #2813 from matrix-org/matthew/registrations_require_3pid (diff) | |
download | synapse-ab9f844aaf3662a64dbc4c56077e9fa37bc7d5d0.tar.xz |
Add federation_domain_whitelist option (#2820)
Add federation_domain_whitelist gives a way to restrict which domains your HS is allowed to federate with. useful mainly for gracefully preventing a private but internet-connected HS from trying to federate to the wider public Matrix network
Diffstat (limited to 'synapse/util')
-rw-r--r-- | synapse/util/retryutils.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/synapse/util/retryutils.py b/synapse/util/retryutils.py index 1adedbb361..47b0bb5eb3 100644 --- a/synapse/util/retryutils.py +++ b/synapse/util/retryutils.py @@ -26,6 +26,18 @@ logger = logging.getLogger(__name__) class NotRetryingDestination(Exception): def __init__(self, retry_last_ts, retry_interval, destination): + """Raised by the limiter (and federation client) to indicate that we are + are deliberately not attempting to contact a given server. + + Args: + retry_last_ts (int): the unix ts in milliseconds of our last attempt + to contact the server. 0 indicates that the last attempt was + successful or that we've never actually attempted to connect. + retry_interval (int): the time in milliseconds to wait until the next + attempt. + destination (str): the domain in question + """ + msg = "Not retrying server %s." % (destination,) super(NotRetryingDestination, self).__init__(msg) |