mirror of
https://github.com/camptocamp/odoo-cloud-platform.git
synced 2026-06-23 18:04:34 +00:00
Merge pull request #511 from camptocamp/19.0-fix-performance
[PERF] fix performance hit
This commit is contained in:
@@ -176,17 +176,10 @@ class RedisSessionStore(SessionStore):
|
|||||||
identifiers = set(identifiers)
|
identifiers = set(identifiers)
|
||||||
not_found = set()
|
not_found = set()
|
||||||
for partial_sid in identifiers:
|
for partial_sid in identifiers:
|
||||||
try:
|
key = f"session::{self.prefix}:{partial_sid}*"
|
||||||
next(
|
match = self.redis.keys(pattern=key)
|
||||||
self.redis.scan_iter(
|
if not match:
|
||||||
match=f"{self.prefix}{partial_sid}*",
|
|
||||||
count=1,
|
|
||||||
)
|
|
||||||
)
|
|
||||||
except StopIteration:
|
|
||||||
# No matches found
|
|
||||||
not_found.add(partial_sid)
|
not_found.add(partial_sid)
|
||||||
|
|
||||||
return not_found
|
return not_found
|
||||||
|
|
||||||
def delete_from_identifiers(self, identifiers: builtins.list[PartialSid]):
|
def delete_from_identifiers(self, identifiers: builtins.list[PartialSid]):
|
||||||
|
|||||||
Reference in New Issue
Block a user