Skip to content

Commit

Permalink
Merge PR OCA#77 into 16.0
Browse files Browse the repository at this point in the history
Signed-off-by simahawk
  • Loading branch information
OCA-git-bot committed Dec 20, 2024
2 parents 9bb851b + 0190a5c commit d911c0e
Showing 1 changed file with 9 additions and 1 deletion.
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

0 comments on commit d911c0e

Please sign in to comment.