diff options
author | Erik Johnston <erik@matrix.org> | 2015-08-18 11:51:08 +0100 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2015-08-18 11:51:08 +0100 |
commit | 6e7d36a72c5778be6d1a79d296b1fcdce667839d (patch) | |
tree | 5a36b40ae8b032158f536eddf9639395b81934fb /synapse/metrics | |
parent | Use more helpful variable names (diff) | |
download | synapse-6e7d36a72c5778be6d1a79d296b1fcdce667839d.tar.xz |
Also check for presence of 'threadCallQueue' in reactor
Diffstat (limited to 'synapse/metrics')
-rw-r--r-- | synapse/metrics/__init__.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/synapse/metrics/__init__.py b/synapse/metrics/__init__.py index 2e307a03ad..d7bcad8a8a 100644 --- a/synapse/metrics/__init__.py +++ b/synapse/metrics/__init__.py @@ -184,7 +184,14 @@ def runUntilCurrentTimer(func): return f -if hasattr(reactor, "runUntilCurrent") and hasattr(reactor, "_newTimedCalls"): +try: + # Ensure the reactor has all the attributes we expect + reactor.runUntilCurrent + reactor._newTimedCalls + reactor.threadCallQueue + # runUntilCurrent is called when we have pending calls. It is called once # per iteratation after fd polling. reactor.runUntilCurrent = runUntilCurrentTimer(reactor.runUntilCurrent) +except AttributeError: + pass |