From bd9be5aacefdbcdf31670dc1e6090265019f3fbf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Fri, 26 Apr 2024 12:30:11 +0200 Subject: [PATCH] Add transaction timeout to export data route Closes #13217 --- trytond/trytond/ir/routes.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/trytond/trytond/ir/routes.py b/trytond/trytond/ir/routes.py index 02b48da454..4f596b4868 100644 --- a/trytond/trytond/ir/routes.py +++ b/trytond/trytond/ir/routes.py @@ -20,6 +20,7 @@ SOURCE = config.get( default='https://cdn.tiny.cloud/1/no-api-key/tinymce/7/tinymce.min.js') AVATAR_TIMEOUT = config.getint( 'web', 'avatar_timeout', default=7 * 24 * 60 * 60) +_request_timeout = config.getint('request', 'timeout', default=0) def get_token(record): @@ -184,7 +185,8 @@ TEMPLATE = ''' @app.route('//data/', methods={'GET'}) @app.auth_required @with_pool -@with_transaction(user='request', context=dict(_check_access=True)) +@with_transaction( + user='request', context=dict(_check_access=True), timeout=_request_timeout) def data(request, pool, model): User = pool.get('res.user') Lang = pool.get('ir.lang')