fix metric

This commit is contained in:
Jack Robison 2022-05-22 12:11:24 -04:00
parent fb98a4d7d0
commit a7e6bcb366
No known key found for this signature in database
GPG key ID: DF25C68FE0239BB2

View file

@ -878,8 +878,6 @@ class LBRYElectrumX(asyncio.Protocol):
"""Handle an incoming request. ElectrumX doesn't receive
notifications from client sessions.
"""
self.session_manager.request_count_metric.labels(method=request.method).inc()
if isinstance(request, Request):
method = request.method
if method == 'blockchain.block.get_chunk':
@ -958,6 +956,7 @@ class LBRYElectrumX(asyncio.Protocol):
raise RPCError(JSONRPC.METHOD_NOT_FOUND, f'unknown method "{method}"')
else:
raise ValueError
self.session_manager.request_count_metric.labels(method=request.method).inc()
if isinstance(request.args, dict):
return await coro(**request.args)
return await coro(*request.args)