diff options
author | Erik Johnston <erik@matrix.org> | 2019-09-06 10:07:12 +0100 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2019-09-06 10:07:12 +0100 |
commit | d8517da85b3057e186087de146f546de52d7e206 (patch) | |
tree | 1f1a1a617a36c3c2eb76f42984619b2ab34f475f /synapse/logging/opentracing.py | |
parent | Trace how long it takes for the send trasaction to complete, including retrys... (diff) | |
download | synapse-d8517da85b3057e186087de146f546de52d7e206.tar.xz |
Don't assume there is a 'self' arg in @trace decorator
Diffstat (limited to 'synapse/logging/opentracing.py')
-rw-r--r-- | synapse/logging/opentracing.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/synapse/logging/opentracing.py b/synapse/logging/opentracing.py index 8c574ddd28..7246253018 100644 --- a/synapse/logging/opentracing.py +++ b/synapse/logging/opentracing.py @@ -702,15 +702,15 @@ def trace(func=None, opname=None): _opname = opname if opname else func.__name__ @wraps(func) - def _trace_inner(self, *args, **kwargs): + def _trace_inner(*args, **kwargs): if opentracing is None: - return func(self, *args, **kwargs) + return func(*args, **kwargs) scope = start_active_span(_opname) scope.__enter__() try: - result = func(self, *args, **kwargs) + result = func(*args, **kwargs) if isinstance(result, defer.Deferred): def call_back(result): @@ -750,13 +750,13 @@ def tag_args(func): return func @wraps(func) - def _tag_args_inner(self, *args, **kwargs): + def _tag_args_inner(*args, **kwargs): argspec = inspect.getargspec(func) for i, arg in enumerate(argspec.args[1:]): set_tag("ARG_" + arg, args[i]) set_tag("args", args[len(argspec.args) :]) set_tag("kwargs", kwargs) - return func(self, *args, **kwargs) + return func(*args, **kwargs) return _tag_args_inner |