Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion endpoint_route_handler/models/ir_http.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ def routing_map(cls, key=None):
# which will in turn use the updated value of the oauth token to compute
# the session token, and the security check will not fail.
registry = registry_get(http.request.env.cr.dbname)
with registry.cursor() as cr:
cr = registry.cursor()
try:
last_version = cls._get_routing_map_last_version(cr)
if not hasattr(cls, "_routing_map"):
_logger.debug(
Expand All @@ -71,6 +72,13 @@ def routing_map(cls, key=None):
cls._routing_map = {}
cls._rewrite_len = {}
cls._endpoint_route_last_version = last_version
finally:
# No commit is needed here as nothing should be modified since
# this cursor is only here to read the last version of the routing
# map in a different cursor than the request one, see above comment.
cr.rollback()
cr.close()

return super().routing_map(key=key)

@classmethod
Expand Down
Loading