summary refs log tree commit diff
path: root/synapse/metrics/__init__.py
diff options
context:
space:
mode:
Diffstat (limited to 'synapse/metrics/__init__.py')
-rw-r--r--synapse/metrics/__init__.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/synapse/metrics/__init__.py b/synapse/metrics/__init__.py
index 4bf081e254..d7475ddf12 100644
--- a/synapse/metrics/__init__.py
+++ b/synapse/metrics/__init__.py
@@ -584,7 +584,7 @@ MIN_TIME_BETWEEN_GCS = (1.0, 10.0, 30.0)
 _last_gc = [0.0, 0.0, 0.0]
 
 
-def callFromThreadTimer(reactor, func):
+def callFromThreadTimer(func):
     @functools.wraps(func)
     def callFromThread(
         self, f: Callable[..., Any], *args: object, **kwargs: object
@@ -695,6 +695,8 @@ try:
     # per iteratation after fd polling.
     reactor.runUntilCurrent = runUntilCurrentTimer(reactor, reactor.runUntilCurrent)  # type: ignore
 
+    reactor.callFromThread = callFromThreadTimer(reactor.callFromThread)
+
     # We manually run the GC each reactor tick so that we can get some metrics
     # about time spent doing GC,
     if not running_on_pypy: