summaryrefslogtreecommitdiff
path: root/addons/web/common/http.py
diff options
context:
space:
mode:
authorFlorent Xicluna <florent.xicluna@gmail.com>2012-01-23 14:53:25 +0100
committerFlorent Xicluna <florent.xicluna@gmail.com>2012-01-23 14:53:25 +0100
commitb09507fd991bd1668fb810bdae7c853bb2866140 (patch)
treec95dcf351980184c94dc0189a114097ab852711d /addons/web/common/http.py
parent5df59ee69dbeea84375fca6ec66f5f7ad97604ad (diff)
[REF] removed_sessions: use a set() instead of a list(), because it's more efficient.
bzr revid: florent.xicluna@gmail.com-20120123135325-m23bgckb948rskal
Diffstat (limited to 'addons/web/common/http.py')
-rw-r--r--addons/web/common/http.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/addons/web/common/http.py b/addons/web/common/http.py
index 6d4bf1536a2..016aff3754e 100644
--- a/addons/web/common/http.py
+++ b/addons/web/common/http.py
@@ -355,7 +355,7 @@ def session_context(request, storage_path, session_cookie='sessionid'):
# Remove all OpenERPSession instances with no uid, they're generated
# either by login process or by HTTP requests without an OpenERP
# session id, and are generally noise
- removed_sessions = []
+ removed_sessions = set()
for key, value in request.session.items():
if (isinstance(value, session.OpenERPSession)
and not value._uid
@@ -363,7 +363,7 @@ def session_context(request, storage_path, session_cookie='sessionid'):
and value._creation_time + (60*5) < time.time() # FIXME do not use a fixed value
):
_logger.debug('remove session %s', key)
- removed_sessions.append(key)
+ removed_sessions.add(key)
del request.session[key]
with session_lock: