summary refs log tree commit diff
path: root/synapse
diff options
context:
space:
mode:
Diffstat (limited to 'synapse')
-rw-r--r--synapse/http/server.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/synapse/http/server.py b/synapse/http/server.py
index d4d639f617..2c131a7017 100644
--- a/synapse/http/server.py
+++ b/synapse/http/server.py
@@ -144,9 +144,10 @@ def wrap_request_handler(request_handler, report_metrics):
                     )
                 finally:
                     try:
-                        request_metrics.stop(
-                            self.clock, request, self.__class__.__name__
-                        )
+                        if report_metrics:
+                            request_metrics.stop(
+                                self.clock, request, self.__class__.__name__
+                            )
                     except:
                         pass
     return wrapped_request_handler