diff options
author | Richard van der Hoff <richard@matrix.org> | 2019-09-19 20:32:25 +0100 |
---|---|---|
committer | Richard van der Hoff <richard@matrix.org> | 2019-09-19 20:32:25 +0100 |
commit | 284e1cb027c2c5e8376a5b83d21d626e18dcbc33 (patch) | |
tree | 39adfb627d806891d95ffabb0bd7490f1fc737eb /synapse/app/_base.py | |
parent | Fix a bug with saml attribute maps. (diff) | |
parent | fix sample config (diff) | |
download | synapse-284e1cb027c2c5e8376a5b83d21d626e18dcbc33.tar.xz |
Merge branch 'develop' into rav/fix_attribute_mapping
Diffstat (limited to 'synapse/app/_base.py')
-rw-r--r-- | synapse/app/_base.py | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/synapse/app/_base.py b/synapse/app/_base.py index 69dcf3523f..c30fdeee9a 100644 --- a/synapse/app/_base.py +++ b/synapse/app/_base.py @@ -36,18 +36,20 @@ from synapse.util.versionstring import get_version_string logger = logging.getLogger(__name__) +# list of tuples of function, args list, kwargs dict _sighup_callbacks = [] -def register_sighup(func): +def register_sighup(func, *args, **kwargs): """ Register a function to be called when a SIGHUP occurs. Args: func (function): Function to be called when sent a SIGHUP signal. - Will be called with a single argument, the homeserver. + Will be called with a single default argument, the homeserver. + *args, **kwargs: args and kwargs to be passed to the target function. """ - _sighup_callbacks.append(func) + _sighup_callbacks.append((func, args, kwargs)) def start_worker_reactor(appname, config, run_command=reactor.run): @@ -248,8 +250,8 @@ def start(hs, listeners=None): # we're not using systemd. sdnotify(b"RELOADING=1") - for i in _sighup_callbacks: - i(hs) + for i, args, kwargs in _sighup_callbacks: + i(hs, *args, **kwargs) sdnotify(b"READY=1") |