Skip to content
Permalink
Browse files

Optimization of settings atrs to current thread.

No needed call slow threading.current_thread() on evry arg setting.
  • Loading branch information...
heckad committed Mar 20, 2019
1 parent 8e2f9a4 commit 603682ffcf3c99b1cf34122b4ea2dc7efdf97f69
Showing with 6 additions and 4 deletions.
  1. +6 −4 odoo/http.py
@@ -1410,10 +1410,12 @@ def dispatch(self, environ, start_response):
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)

0 comments on commit 603682f

Please sign in to comment.
You can’t perform that action at this time.