Commit 0e054e5d authored by Michal Čihař's avatar Michal Čihař

Use keys iterator

Signed-off-by: default avatarMichal Čihař <michal@cihar.com>
parent 61debe23
...@@ -73,7 +73,7 @@ def cleanup_session(session): ...@@ -73,7 +73,7 @@ def cleanup_session(session):
Deletes old search results from session storage. Deletes old search results from session storage.
''' '''
now = int(time.time()) now = int(time.time())
for key in session: for key in session.keys():
value = session[key] value = session[key]
if (key.startswith('search_') if (key.startswith('search_')
and (not isinstance(value, dict) or value['ttl'] < now)): and (not isinstance(value, dict) or value['ttl'] < now)):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment