summary refs log tree commit diff
path: root/synapse/util/__init__.py
diff options
context:
space:
mode:
authorBrendan Abolivier <babolivier@matrix.org>2019-08-28 18:17:26 +0100
committerBrendan Abolivier <babolivier@matrix.org>2019-08-28 18:17:26 +0100
commite5df12ad1668ba1d75e3d5fdf5fe1cb7d0a43400 (patch)
tree6434740f5f259c420f0863ad50d7a0ff3314d5a9 /synapse/util/__init__.py
parentImplement per-room message retention policies (diff)
parentMerge pull request #5812 from matrix-org/babolivier/account-validity-messages (diff)
downloadsynapse-e5df12ad1668ba1d75e3d5fdf5fe1cb7d0a43400.tar.xz
Merge branch 'dinsic' into babolivier/dinsic-message-retention
Diffstat (limited to 'synapse/util/__init__.py')
-rw-r--r--synapse/util/__init__.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/synapse/util/__init__.py b/synapse/util/__init__.py

index 0ae7e2ef3b..8f5a526800 100644 --- a/synapse/util/__init__.py +++ b/synapse/util/__init__.py
@@ -58,7 +58,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, **kwargs): """Call a function repeatedly. Waits `msec` initially before calling `f` for the first time. @@ -66,8 +66,10 @@ class Clock(object): Args: f(function): The function to call repeatedly. msec(float): How long to wait between calls in milliseconds. + *args: Postional arguments to pass to function. + **kwargs: Key arguments to pass to function. """ - call = task.LoopingCall(f) + call = task.LoopingCall(f, *args, **kwargs) call.clock = self._reactor d = call.start(msec / 1000.0, now=False) d.addErrback(