fix: change _dispatch function signature (#355)

This commit is contained in:
Vincent Renaville authored and GitHub committed 2022-03-16 14:22:55 +01:00
1 parent 61aadafabf
commit f99d03dd0e
1 file changed
+4 -5
+4 -5
View File
@@ -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
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.