[FIX] event: fix savepoint issue with event mail scheduler
This commit removes a savepoint call when running the event mail scheduler. Indeed, this save point registration was colliding with the fact that we commit the assets bundle during the reporting process, see 'commit_assetsbundle' context key. Since the transaction was commit during the report generation, when reaching the end of the savepoint block, the system was trying to release a savepoint that was no longer existing. Indeed, committing removes all savepoints, since (quoting the Postgres doc) "Savepoints can only be established when inside a transaction block.", which makes total sense. This was leading to a: bad query: RELEASE SAVEPOINT "669516d2915811eba8d2b4d5bde7cdcc" Aborting the whole event mail scheduler process. As it's rather unclear why this savepoint was introduced in the first place, we attempt to remove it. This change is done in a singular commit to be easily revertable if ever necessary. Task-26779
This commit is contained in:
@@ -235,9 +235,8 @@ You receive this email because you are:
|
||||
|
||||
for scheduler in schedulers:
|
||||
try:
|
||||
with self.env.cr.savepoint():
|
||||
# Prevent a mega prefetch of the registration ids of all the events of all the schedulers
|
||||
self.browse(scheduler.id).execute()
|
||||
# Prevent a mega prefetch of the registration ids of all the events of all the schedulers
|
||||
self.browse(scheduler.id).execute()
|
||||
except Exception as e:
|
||||
_logger.exception(e)
|
||||
self.invalidate_cache()
|
||||
|
||||
Reference in New Issue
Block a user