summaryrefslogtreecommitdiff
path: root/odoo/http.py
diff options
context:
space:
mode:
authorKazantcev Andrey <heckad@yandex.ru>2019-03-20 22:32:20 +0000
committerMartin Trigaux <mat@odoo.com>2019-04-10 07:18:59 +0000
commit6b73d23f7a862ce1a3e99d779b725064d79e1f2b (patch)
tree5abd2b7bd59527b5f3d25c40e543683530f79e57 /odoo/http.py
parent1656557e815d80f92e7c00e71600da75bc34a238 (diff)
[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) <mat@odoo.com>
Diffstat (limited to 'odoo/http.py')
-rw-r--r--odoo/http.py10
1 files 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)