Merge branch 'mig-19.0-session_redis' of https://github.com/camptocamp/odoo-cloud-platform into merge-branch-2473-mig-session_redis-19.0-batch-20260612-worker-3-721685ad

# Conflicts:
#	session_redis/session.py
This commit is contained in:
Odoo Migration Factory
2026-06-15 15:07:01 +02:00
+14 -7
View File
@@ -176,10 +176,17 @@ class RedisSessionStore(SessionStore):
identifiers = set(identifiers)
not_found = set()
for partial_sid in identifiers:
key = f"session::{self.prefix}:{partial_sid}*"
match = self.redis.keys(pattern=key)
if not match:
try:
next(
self.redis.scan_iter(
match=f"{self.prefix}{partial_sid}*",
count=1,
)
)
except StopIteration:
# No matches found
not_found.add(partial_sid)
return not_found
def delete_from_identifiers(self, identifiers: builtins.list[PartialSid]):
@@ -192,12 +199,12 @@ class RedisSessionStore(SessionStore):
"""
patterns_to_unlink = []
for identifier in identifiers:
# Avoid removing a session if it does not match an identifier. See this same
# comment in odoo.http.FileSessionStore.delete_from_identifiers.
# Avoid removing a session if it does not match an identifier.
# See this same comment in odoo.http.FileSessionStore.delete_from_identifiers.
if not odoo.http._session_identifier_re.match(identifier):
raise ValueError(
"Identifier format incorrect, did you pass in a string instead ",
"of a list?",
"Identifier format incorrect, did you pass in a string instead "
"of a list?"
)
patterns_to_unlink.append(f"{self.prefix}{identifier}*")
keys_to_unlink = []