diff options
author | Brendan Abolivier <babolivier@matrix.org> | 2019-07-26 18:45:31 +0200 |
---|---|---|
committer | Brendan Abolivier <babolivier@matrix.org> | 2019-07-29 09:54:37 +0200 |
commit | 08352d44f81a76ba53fc96753cc5038589defaa7 (patch) | |
tree | 3cedf8a3413a2d978d4e568c333d196851dd67de /synapse/util | |
parent | Merge branch 'master' into develop (diff) | |
download | synapse-08352d44f81a76ba53fc96753cc5038589defaa7.tar.xz |
Add ability to pass arguments to looping calls
Diffstat (limited to 'synapse/util')
-rw-r--r-- | synapse/util/__init__.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/synapse/util/__init__.py b/synapse/util/__init__.py index 841625a991..9e0a47d206 100644 --- a/synapse/util/__init__.py +++ b/synapse/util/__init__.py @@ -59,7 +59,7 @@ class Clock(object): """Returns the current system time in miliseconds since epoch.""" return int(self.time() * 1000) - def looping_call(self, f, msec): + def looping_call(self, f, msec, *args): """Call a function repeatedly. Waits `msec` initially before calling `f` for the first time. @@ -71,7 +71,7 @@ class Clock(object): f(function): The function to call repeatedly. msec(float): How long to wait between calls in milliseconds. """ - call = task.LoopingCall(f) + call = task.LoopingCall(f, *args) call.clock = self._reactor d = call.start(msec / 1000.0, now=False) d.addErrback(log_failure, "Looping call died", consumeErrors=False) |