From 6b73d23f7a862ce1a3e99d779b725064d79e1f2b Mon Sep 17 00:00:00 2001 From: Kazantcev Andrey Date: Wed, 20 Mar 2019 22:32:20 +0000 Subject: [PATCH] [IMP] http: code cleaning reuse current_thread result No needed to call threading.current_thread() on evry arg setting closes odoo/odoo#32000 Signed-off-by: Martin Trigaux (mat) --- odoo/http.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/odoo/http.py b/odoo/http.py index 886fecc48ba..ddb18eb1048 100644 --- a/odoo/http.py +++ b/odoo/http.py @@ -1410,10 +1410,12 @@ class Root(object): httprequest = werkzeug.wrappers.Request(environ) httprequest.app = self httprequest.parameter_storage_class = werkzeug.datastructures.ImmutableOrderedMultiDict - threading.current_thread().url = httprequest.url - threading.current_thread().query_count = 0 - threading.current_thread().query_time = 0 - threading.current_thread().perf_t0 = time.time() + + current_thread = threading.current_thread() + current_thread.url = httprequest.url + current_thread.query_count = 0 + current_thread.query_time = 0 + current_thread.perf_t0 = time.time() explicit_session = self.setup_session(httprequest) self.setup_db(httprequest)