mirror of
https://github.com/camptocamp/odoo-cloud-platform.git
synced 2026-06-24 02:08:36 +00:00
Change CI to GitHub actions
Use copier template from oca/oca-addons-repo-template Apply linting
This commit is contained in:
@@ -4,38 +4,46 @@
|
||||
from odoo import models
|
||||
from odoo.http import request
|
||||
|
||||
from ..statsd_client import statsd, customer, environment
|
||||
from ..statsd_client import customer, environment, statsd
|
||||
|
||||
|
||||
class IrHttp(models.AbstractModel):
|
||||
_inherit = 'ir.http'
|
||||
_inherit = "ir.http"
|
||||
|
||||
@classmethod
|
||||
def _dispatch(cls):
|
||||
if not statsd:
|
||||
return super()._dispatch()
|
||||
|
||||
path_info = request.httprequest.environ.get('PATH_INFO')
|
||||
if path_info.startswith('/longpolling/'):
|
||||
path_info = request.httprequest.environ.get("PATH_INFO")
|
||||
if path_info.startswith("/longpolling/"):
|
||||
return super()._dispatch()
|
||||
|
||||
parts = ['http', ]
|
||||
if path_info.startswith('/web/dataset/call_button'):
|
||||
parts += ['button',
|
||||
customer, environment,
|
||||
request.params['model'].replace('.', '_'),
|
||||
request.params['method'],
|
||||
]
|
||||
elif path_info.startswith('/web/dataset/exec_workflow'):
|
||||
parts += ['workflow',
|
||||
customer, environment,
|
||||
request.params['model'].replace('.', '_'),
|
||||
request.params['signal'],
|
||||
]
|
||||
parts = [
|
||||
"http",
|
||||
]
|
||||
if path_info.startswith("/web/dataset/call_button"):
|
||||
parts += [
|
||||
"button",
|
||||
customer,
|
||||
environment,
|
||||
request.params["model"].replace(".", "_"),
|
||||
request.params["method"],
|
||||
]
|
||||
elif path_info.startswith("/web/dataset/exec_workflow"):
|
||||
parts += [
|
||||
"workflow",
|
||||
customer,
|
||||
environment,
|
||||
request.params["model"].replace(".", "_"),
|
||||
request.params["signal"],
|
||||
]
|
||||
else:
|
||||
parts += ['request',
|
||||
customer, environment,
|
||||
]
|
||||
parts += [
|
||||
"request",
|
||||
customer,
|
||||
environment,
|
||||
]
|
||||
|
||||
with statsd.timer('.'.join(parts)):
|
||||
with statsd.timer(".".join(parts)):
|
||||
return super()._dispatch()
|
||||
|
||||
Reference in New Issue
Block a user