From f99d03dd0e56a1c64b5febea592f3de53d33f608 Mon Sep 17 00:00:00 2001 From: Vincent Renaville Date: Wed, 16 Mar 2022 14:22:55 +0100 Subject: [PATCH] fix: change _dispatch function signature (#355) --- monitoring_prometheus/models/ir_http.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/monitoring_prometheus/models/ir_http.py b/monitoring_prometheus/models/ir_http.py index 62c01bd..d57cf83 100644 --- a/monitoring_prometheus/models/ir_http.py +++ b/monitoring_prometheus/models/ir_http.py @@ -25,16 +25,15 @@ LONGPOLLING_COUNT = Counter("longpolling", "Longpolling request count") class IrHttp(models.AbstractModel): _inherit = "ir.http" - @classmethod - def _dispatch(cls): + def _dispatch(self): path_info = request.httprequest.environ.get("PATH_INFO") if path_info.startswith("/longpolling/"): LONGPOLLING_COUNT.inc() - return super(IrHttp, cls)._dispatch() + return super(IrHttp, self)._dispatch() if path_info.startswith("/metrics"): - return super(IrHttp, cls)._dispatch() + return super(IrHttp, self)._dispatch() if path_info.startswith("/web/static"): label = "assets" @@ -45,6 +44,6 @@ class IrHttp(models.AbstractModel): res = None with REQUEST_TIME.labels(label).time(): - res = super(IrHttp, cls)._dispatch() + res = super(IrHttp, self)._dispatch() return res