From 33a02f0f52a5cd793c0d123463d8a7a1e3f4f198 Mon Sep 17 00:00:00 2001 From: Patrick Cloke Date: Wed, 3 Mar 2021 15:47:38 -0500 Subject: Fix additional type hints from Twisted upgrade. (#9518) --- synapse/metrics/__init__.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'synapse/metrics/__init__.py') diff --git a/synapse/metrics/__init__.py b/synapse/metrics/__init__.py index a8cb49d5b4..3b499efc07 100644 --- a/synapse/metrics/__init__.py +++ b/synapse/metrics/__init__.py @@ -527,7 +527,7 @@ class ReactorLastSeenMetric: REGISTRY.register(ReactorLastSeenMetric()) -def runUntilCurrentTimer(func): +def runUntilCurrentTimer(reactor, func): @functools.wraps(func) def f(*args, **kwargs): now = reactor.seconds() @@ -590,13 +590,14 @@ def runUntilCurrentTimer(func): try: # Ensure the reactor has all the attributes we expect - reactor.runUntilCurrent - reactor._newTimedCalls - reactor.threadCallQueue + reactor.seconds # type: ignore + reactor.runUntilCurrent # type: ignore + reactor._newTimedCalls # type: ignore + reactor.threadCallQueue # type: ignore # runUntilCurrent is called when we have pending calls. It is called once # per iteratation after fd polling. - reactor.runUntilCurrent = runUntilCurrentTimer(reactor.runUntilCurrent) + reactor.runUntilCurrent = runUntilCurrentTimer(reactor, reactor.runUntilCurrent) # type: ignore # We manually run the GC each reactor tick so that we can get some metrics # about time spent doing GC, -- cgit 1.4.1