Skip to content

Commit

Permalink
[FIX] endpoint_route_handler: Rollback dedicated routing cursor
Browse files Browse the repository at this point in the history
  • Loading branch information
paradoxxxzero committed Dec 9, 2024
1 parent 9bb851b commit 19023b5
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 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,10 @@ def routing_map(cls, key=None):
cls._routing_map = {}
cls._rewrite_len = {}
cls._endpoint_route_last_version = last_version
finally:
cr.rollback()
cr.close()

return super().routing_map(key=key)

@classmethod
Expand Down

0 comments on commit 19023b5

Please sign in to comment.