[FIX] base: skip failed autovaccum
This patch prevents bugs fixed at 5d463d2 to block the database.
It was preventing the autovacuum to properly clean old records.
Failing to unlink (may have various different reasons) should not block the
autovacuum to try on other models
Closes #23455
This commit is contained in:
@@ -17,7 +17,11 @@ class AutoVacuum(models.AbstractModel):
|
||||
for mname in self.env:
|
||||
model = self.env[mname]
|
||||
if model.is_transient():
|
||||
model._transient_vacuum(force=True)
|
||||
try:
|
||||
with cr.savepoint():
|
||||
model._transient_vacuum(force=True)
|
||||
except Exception as e:
|
||||
_logger.warning("Failed to clean transient model %s\n%s", model, str(e))
|
||||
|
||||
@api.model
|
||||
def _gc_user_logs(self):
|
||||
|
||||
Reference in New Issue
Block a user