mirror of
https://github.com/camptocamp/odoo-cloud-platform.git
synced 2026-06-24 16:48:36 +00:00
fix: change _dispatch function signature (#355)
This commit is contained in:
co-authored by
GitHub
parent
61aadafabf
commit
f99d03dd0e
@@ -25,16 +25,15 @@ LONGPOLLING_COUNT = Counter("longpolling", "Longpolling request count")
|
|||||||
class IrHttp(models.AbstractModel):
|
class IrHttp(models.AbstractModel):
|
||||||
_inherit = "ir.http"
|
_inherit = "ir.http"
|
||||||
|
|
||||||
@classmethod
|
def _dispatch(self):
|
||||||
def _dispatch(cls):
|
|
||||||
path_info = request.httprequest.environ.get("PATH_INFO")
|
path_info = request.httprequest.environ.get("PATH_INFO")
|
||||||
|
|
||||||
if path_info.startswith("/longpolling/"):
|
if path_info.startswith("/longpolling/"):
|
||||||
LONGPOLLING_COUNT.inc()
|
LONGPOLLING_COUNT.inc()
|
||||||
return super(IrHttp, cls)._dispatch()
|
return super(IrHttp, self)._dispatch()
|
||||||
|
|
||||||
if path_info.startswith("/metrics"):
|
if path_info.startswith("/metrics"):
|
||||||
return super(IrHttp, cls)._dispatch()
|
return super(IrHttp, self)._dispatch()
|
||||||
|
|
||||||
if path_info.startswith("/web/static"):
|
if path_info.startswith("/web/static"):
|
||||||
label = "assets"
|
label = "assets"
|
||||||
@@ -45,6 +44,6 @@ class IrHttp(models.AbstractModel):
|
|||||||
|
|
||||||
res = None
|
res = None
|
||||||
with REQUEST_TIME.labels(label).time():
|
with REQUEST_TIME.labels(label).time():
|
||||||
res = super(IrHttp, cls)._dispatch()
|
res = super(IrHttp, self)._dispatch()
|
||||||
|
|
||||||
return res
|
return res
|
||||||
|
|||||||
Reference in New Issue
Block a user