summary refs log tree commit diff
path: root/synapse
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2016-08-19 18:13:07 +0100
committerErik Johnston <erik@matrix.org>2016-08-19 18:23:45 +0100
commit8731197e54f4f004f19f87fd5fa5b4ed7ad5b8be (patch)
tree4b989e5a3e6dd67fd4a97bf7023f4e6095dffc9e /synapse
parentdefer.returnValue must not be called within Measure (diff)
downloadsynapse-8731197e54f4f004f19f87fd5fa5b4ed7ad5b8be.tar.xz
Only abort Measure on Exceptions
Diffstat (limited to 'synapse')
-rw-r--r--synapse/util/metrics.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/synapse/util/metrics.py b/synapse/util/metrics.py
index 76f301f549..4ea930d3e8 100644
--- a/synapse/util/metrics.py
+++ b/synapse/util/metrics.py
@@ -87,7 +87,7 @@ class Measure(object):
         self.db_txn_duration = self.start_context.db_txn_duration
 
     def __exit__(self, exc_type, exc_val, exc_tb):
-        if exc_type is not None or not self.start_context:
+        if isinstance(exc_type, Exception) or not self.start_context:
             return
 
         duration = self.clock.time_msec() - self.start